+ 1

PHP code isn't responding

When i run my PHP code, it's written 'Undefined index: first-hand in C:\xampp\htdocs\test\process.php on line 3. How do I solve this problem?

11th Aug 2017, 9:15 AM
Abdul Shakur Abbas Sakhr
Abdul Shakur Abbas Sakhr - avatar
5 Antworten
+ 8
Probably an array issue easy_to_solve, where's the code?
11th Aug 2017, 9:57 AM
Maz
Maz - avatar
+ 8
@Mohit Mehta, there's no need to close the <?php tag whether the page contains only PHP content. @Abdul Shakur Abbas Sakhr, put a comma here: mysqli_query($connect, statements); Usually i use the OOP mysqli style to connect PHP and MySQL, make sure all fields in your form are correctly filled before to insert values!
11th Aug 2017, 12:05 PM
Maz
Maz - avatar
+ 1
you have not completed php tag
11th Aug 2017, 11:54 AM
Mohit Mehta
Mohit Mehta - avatar
0
<?php include 'database.php';> <?php // create a variable $firstname=$_POST['firstname']; $surname=$_POST['surname']; $username=$_POST['username']; $pwd=$_POST['pwd']; $cnf=$_POST['cnf']; $gender=$_POST['gender']; $dob=$_POST['dob']; $country=$_POST['country']; $attach_pic=$_POST['attach_pic']; $email=$_POST['email']; $tel=$_POST['tel']; $address=$_POST['address']; $bloodgroup=$_POST['bloodgroup']; $sicklecell=$_POST['sicklecell']; $history=$_POST['history']; //Execute the query mysqli_query($connect"INSERT INTO employees1(firstname,surname,username,pwd,cnf,gender,dob,country,attach_pic,email,tel,address,bloodgroup,sicklecell,history) VALUES('$firstname','$surname','$username','$pwd','$cnf','$gender','$dob','$country','$attach_pic','$email','$tel','$address','$bloodgroup','$sicklecell','$history')");
11th Aug 2017, 11:15 AM
Abdul Shakur Abbas Sakhr
Abdul Shakur Abbas Sakhr - avatar
0
this is the code
11th Aug 2017, 11:15 AM
Abdul Shakur Abbas Sakhr
Abdul Shakur Abbas Sakhr - avatar