I am using PHP 4 with MySqL on win 98 with PWS. I am trying to test out an html form that gathers usual stuff like lastname, firstname, status etc. Sample mark up below;
<form action="submit.php" method="post">
Last Name<input type="text" name="lastname" size="25">
First Name<input type="text" name="firstname" size="25" >
Middle Initial<input type="text" name="middleI" size="2"> <br><br>
Then I want to insert this into the MySQL database via php code. See below;
<?php
mysql_connect('localhost');
mysql_select_db('employee');
$hiredate=$hiredate3 . "-" . $hiredate1 . "-" . $hiredate2;
mysql_query("INSERT INTO profile(lastname,firstname, agency, status, middleI,hiredate,position,hs,col,coldegree,colmajor, licenses,work_yeas, ddwork_years, prevmodules,email,snaimail)VALUES($lastname,'$firstname','$agency','$status','$middleI','$hiredate','$position','$hs','$col','$coldegree','$colmajor','$licenses','$work_years','$ddwork_years','$prevmodules','$email','$snailmail')");
The error returns undefined variable and it lists all the fields from the form that I have assumed PHP would turn into variables and insert into the database. Please note I did not include all of the html form or this message would be pages long. What am I missing?