<?php
if (isset ($_POST['chk8'])) {
$req1 = "Service Protection Plan (SPP)\n";
} else {
$req1 = "None\n";
}
if (isset ($_POST['chk9'])) {
$req2 = "Three Product Welcome Kit (Scientific Atlanta)\n";
} else {
$req2 = "None\n";
}
if (isset ($_POST['chk10'])) {
$req3 = "Three Product Welcome Kit (Motorola)\n";
} else {
$req3 = "None\n";
}
if (isset ($_POST['chk11'])) {
$req4 = "Channel Guide Magazine\n";
} else {
$req4 = "None\n";
}
if (isset ($_POST['chk12'])) {
$req5 = "Channel Line Up\n";
} else {
$req5 = "None\n";
}
if (isset ($_POST['chk13'])) {
$req6 = "Identity Theft Form\n";
} else {
$req6 = "None\n";
}
if (isset ($_POST['chk14'])) {
$req7 = " \n";
} else {
$req7 = "None\n";
}
?>
<?php
$DBHost = "db1.thinkhost.com";
$DBuser = "jaydude23";
$DBpass = "killough";
$DBname = "jaydude23";
$table = "twc";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBname") or die("Unable to select database $DBname");
$sqlquery = "INSERT INTO $table VALUES(now(),'$CSP_Name','$Supervisor','$Rep_Number','$Department','$Email','$req1','$req2','$req3','$req4','$req5','$req6','$req7','$Account_No','$First_Name','$Last_Name','$Phone','$ShipTo_Address','$ShipTo_City','$ShipTo_State','$ShipTo_ZIP','$Additional_Info','$Accept')";
$results = mysql_query($sqlquery);
mysql_close();
print "<html><body><center>";
print "<p>Your request was added sucessfully<p>";
print "</body></html>";
?>
I have a form on my website, which a user fills out, and then clicks 'submit'. This php code is supposed to take the data entered on the form and added it to a mysql database.
Its not working, no record is entered, all it says is "Your request was added sucessfully". What is wrong here?? Thanks in advance for all your help.