I am trying to write information from a form on a base, however when I generate the following code below an error is presented in the file saying:
Notice: Undefined index: txtFirstName in C:\xampp\htdocs\begin\service.php on line 64
Notice: Undefined index: txtLastName in C:\xampp\htdocs\begin\service.php on line 65
Notice: Undefined index: ddlGender in C:\xampp\htdocs\begin\service.php on line 66
Notice: Undefined index: txtMinutes in C:\xampp\htdocs\begin\service.php on line 67
Notice: Undefined index: txtSeconds in C:\xampp\htdocs\begin\service.php on line 68
Notice: Undefined variable: mysqli_query in C:\xampp\htdocs\begin\service.php on line 74
Fatal error: Uncaught Error: Function name must be a string in C:\xampp\htdocs\begin\service.php:74 Stack trace: #0 {main} thrown in C:\xampp\htdocs\begin\service.php on line 74
The code I'm using to define the variables is this, which matches the above error lines.
I'm not a PHP Expert and found no response to my problem in the PHP doc. Could someone please help me. I'm using PHP7
$fname = htmlspecialchars($_POST['txtFirstName']);
$lname = htmlspecialchars($_POST['txtLastName']);
$gender = htmlspecialchars($_POST['ddlGender']);
$minutes = htmlspecialchars($_POST['txtMinutes']);
$seconds = htmlspecialchars($_POST['txtSeconds']);
$time = $minutes . ':' . $seconds;
My insert looks like this:
$mysqli_query($conect, 'INSERT INTO runners(first_name, last_name, gender, finish_time) values("$fname", "$lname", "$gender", "$time")');