DO NOT USE THIS
extract($_REQUEST);
Also On line 15 on the Php code
the global $_POST cant not be written in lowercase $_post as it will be NULL and nothing will be inserted to your database
Amr87
Junior Poster in Training
67 posts since Feb 2011
Reputation Points: 12
Solved Threads: 13
Your php code should be like this:
<?php
/**
* @author 00092
* @copyright 2011
*/
$con = mysql_connect("localhost", "root", "pass");
if (!$con) {
die('could not connect:' . mysql_error());
}
mysql_select_db("info", $con);
$sql = "insert into `reference` (`fullname`,`fname`,`birth`)
values ('$_post[fullname]','$_post[fname]','$_post[birth]')";
if (mysql_query($sql, $con)) {
echo "Done";
} else {
}
mysql_close($con);
?>
Just remove the line no.7
rv1990
Junior Poster in Training
51 posts since Aug 2011
Reputation Points: 17
Solved Threads: 7
rv1990 : Why you are posting repeated solutions?
what`s new in your solutions?
Weird !!!!
Amr87
Junior Poster in Training
67 posts since Feb 2011
Reputation Points: 12
Solved Threads: 13
Cool down friend! There is no need in panicking, acting weird.
rv1990
Junior Poster in Training
51 posts since Aug 2011
Reputation Points: 17
Solved Threads: 7
remove the:
extract($_REQUEST);
and replace it with:
$fullname = $_REQUEST['fullname'];
$fname = $_REQUEST['fname'];
$birth = $_REQUEST['birth'];
and for your query:
$sql = "insert into `reference` (`fullname`,`fname`,`birth`)
values (".$fullname.",".$fname.",".$birth.")";
decade
Junior Poster in Training
62 posts since Jun 2011
Reputation Points: 12
Solved Threads: 14