Thread: php and mySQL
View Single Post
04-04-2007, 11:27 AM
#3
Immersion is offline Immersion
Status: Senior Member
Join date: Dec 2005
Location:
Expertise:
Software:
 
Posts: 918
iTrader: 5 / 100%
 

Immersion is on a distinguished road

  Old

$query = "INSERT INTO contacts VALUES ('','$first','$last','$phone','$mobile','$fax','$e mail','$web')";

you have not used the $_POST function to get the values. You will need to define them using

$first = $_POST['first'];
above the query (for each of them). You should also run some validation checks after it is working to ensure they are not empty etc.

if(empty($first)) {
echo "you did not fill in the first field";
exit;
}

Thats the kind of principle you will need to use.