+ 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?
5 ответов
+ 8
Probably an array issue easy_to_solve, where's the code?
+ 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!
+ 1
you have not completed php tag
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')");
0
this is the code