I have a problem. I am creating a adminsions form and everything is going fine. I have too pages the admin.html and the phphandler.php.
The admin.html is posting to the phphandler.php and it's connecting to mysql fine but when I check the tables for the data that was submitted from the admin.html it's blank, the only thing that shows is the id and that's because it's set to auto_increment.
here is the code for the phphandler.php
<?php
//connect to the icprjc db
mysql_connect('localhost', 'root', '******')
or die('Failure to connect to the database');
mysql_select_db('icprjc');
//insert data
$query = "insert into studentinfo (nombre, apellidos, SeguroSoc)
values('$fname', '$lname', '$SeguroSoc')";
$result = mysql_query($query);
if (mysql_affected_rows() == 1) {
echo '<p>Your info has been entered</p>';
}else{
error_log(mysql_error());
echo'<p>Something went wrong</p>';
}
?>
and here is the html for the 3 textbox's:
<html>
1.<FONT
face="Arial, Helvetica, sans-serif">*Nombre</FONT></DIV></TD>
<TD width="44%"><FONT face="Arial, Helvetica, sans-serif"><INPUT type="text"
size=30 name="$fname"> </FONT>
<FONT
face="Arial, Helvetica, sans-serif">*Apellidos</FONT></DIV></TD>
<TD><FONT face="Arial, Helvetica, sans-serif"><INPUT id="$lname" size=30
name="$lname"> </FONT>
<FONT face="Arial, Helvetica, sans-serif">Numero Seguro
Social</FONT></DIV></TD>
<TD><FONT face="Arial, Helvetica, sans-serif"><INPUT id="$SeguroSoc"
Value="" size=30 maxlength="9">
</FONT>
</html>