how can this code run on my local mysql database
i already change the parameters to connect to mysql server and my PHP, mysql, and apache is running fine but i cannot insert a record to my local database . please help!!
the code starts here:
<html>
<head>
<title>Online Reservation</title>
<!--company x online reservation created by Mark Anthony R. Lisao-->
</head>
<?
//note : $first_pass variable is hidden in the form
empty($first_pass) ?
show_form() :
data_keep($first_name, $last_name, $email, $address, $contact_no,
$units_sedan, $units_pickup, $units_van, $month, $day,
$year, $inquiries);
exit;
?>
<?
function untaint($x){
chop($x);
$x=strtolower($x);
$x=ereg_replace("[!#\$%()+=<>]", "", $x);
return $x;
//clean up user input data
}
function data_keep($d1, $d2, $d3, $d4, $d5,
$d6, $d7, $d8, $d9, $d10,
$d11, $d12){
$arr=array("first_name" => $d1,
"last_name" => $d2,
"email_address" => $d3,
"business_address" => $d4,
"contact_no" => $d5
);
//error handler
$empty_vals=array();
while (list($key, $value )=each($arr)){
untaint($value);
if($value==""){
array_push($empty_vals, $key);
}
}
if (empty($empty_vals)){
//establishing database connection
//i tried to change this parameter to fit my
// configuration
$db_loc=mysql_connect("freesql.org", "markl", "asia12");
mysql_select_db("markl", $db_loc);
//i already change this parameters to fit my configuration
$query="INSERT INTO crc_data (first_name, last_name, email, address, contact_no,
units_sedan, units_pickup, units_van, month, day,
year, inquiries) VALUES
('$d1', '$d2', '$d3', '$d4', '$d5',
'$d6', '$d7', '$d8', '$d9', '$d10',
'$d11', '$d12')";
mysql_query($query);
//entry succesfully added
... the code is too long !!! please see attachment