Hi!
Can you be more precise plz cuz i cant get clear examples of how to do this and in which form.
My form to enter information is below:
<?php
include ("connect.php");
?>
<h2>Please Enter Your Information </h2>
<form action= add.php action=post>
<input type=int name=id>id <br>
<input type=text name=first_name>first_name <br>
<input type=text name=surname>surname <br>
<input type=text name=tel_no>tel_no <br>
<input type=text name=fax_no>fax_no<p>
<input type="submit" name="submit" value="submit">
</form>
After submition,the information is inserted in the database by this code:
<?php
include("connect.php");
if ($submit == "submit")
{
$query = "insert into details
(id_no,first_name,last_name,tel_no,fax_no)
values ('$id_name','$first_name','$last_name','$tel_no','$fax_no')";
$result = mysql_query($query) or
die (mysql_error());
echo "thanks for entering information<b>\n";
}
else
{
echo "View Information";
}
?>
My question is how do i make sure that users insert int where relevant and string as defined by the data types i've defined.