going bald 101
ok complete newb to sql and php here.. i have an application form script that i'm trying to get to email to a specified email address and also store it into a sql database for backup purposes... the email portion of the script works just peachy... but the sql scripting isn't... it doesn't show me any errors yet it doesn't add anything to the database table... below the cut is some of the code if you guys/gals could help it would be VERY much appreciated!!
My PHP version is: 4.3.8
SQL version: 4.0.20-standard
// check to make sure application was filled out
if ($_POST[hackcheck] == "okie doke") {
//form the email
$msg = "Name: $_POST[realname]\n";
$msg .= "Birthdate: $_POST[bdate]\n";
$msg .= "Current Nick: $_POST[currentnick]\n";
$msg .= "Desired Nick: $_POST[desirednick]\n";
$msg .= "Email: $_POST[email]\n";
$msg .= "Location: $_POST[locale]\n";
$msg .= "Time Zone: $_POST[timezone]\n";
$msg .= "I prefer to play $_POST[preftour] tournaments.\n\n";
$msg .= "I use $_POST[iuse] messenger the most.\n";
$msg .= "My MSN Addy is: $_POST[msnnick]\n";
$msg .= "My Y! nick is: $_POST[yahoonick]\n";
$msg .= "My AIM nick is: $_POST[aimnick]\n";
$msg .= "MY ICQ nick is: $_POST[icqnick]\n\n";
$msg .= "Do I have a plus nick? $_POST[haveplus]\n";
if ($_POST[haveplus] == "yes") {
$msg .= " My plus nick is: $_POST[plusnick]\n";
}
$msg .= "\n";
$msg .= "Have I belonged to any other teams in the past? $_POST[prevteam]\n";
if ($_POST[prevteam] == "yes") {
$msg .= "The teams were: $_POST[prevteams]\n";
}
$msg .= "\n";
$msg .= "I know the following RS Artists:\n";
$msg .= "$_POST[knownrs]\n\n";
$msg .= "And a little about me...";
$msg .= "$_POST[bio]\n\n";
// form email headers
$to = "mynameis__jade@hotmail.com";
$subject = "Yet Another RS Application";
$mailheaders = "Application sent from http://www.rockinspaderz.com/html/application.htm";
$mailheaders .= "Please REPLY-TO: $_POST[email]";
// send the email
mail($to, $subject, $msg, $mailheaders) or die("couldn't send email");
// Display Confirmation of email being sent
echo "Your application has been emailed and a member of management will be in contact with you soon to finalize the things that need to be done. Thanks for you interest in the Rockin Spaderz!\n\n\n";
// Create Database Connection
$db_name = "deleted for db protection";
$table_name = "form_applications";
$connection = mysql_connect(localhost, deleted for db protection, deleted for db protection) or die(mysql_error());
$db = mysql_select_db($db_name, $connection);
// Enter the data into the database table
$sql = "INSERT INTO $table_name (realname, desirednick, bdate, locale, timezone, email, iuse, msnnick, yahoonick, aimnick, icqnick, currentnick, preftour, haveplus, plusnick, prevteam, prevteams, knownrs, want2host, bio) VALUES ($_POST[realname], $_POST[desirednick], $_POST[bdate], $_POST[locale], $_POST[timezone], $_POST[email], $_POST[iuse], $_POST[msnnick], $_POST[yahoonick], $_POST[aimnick], $_POST[icqnick], $_POST[currentnick], $_POST[preftour], $_POST[haveplus], $_POST[plusnick], $_POST[prevteam], $_POST[prevteams], $_POST[knownrs], $_POST[want2host], $_POST[bio])";
$result = mysql_query($sql, $connection);
// Display confirmation of database entry
echo "$mysql_query";
} else {
echo "
}
if you can help PLEASE DO I AM GOING CRAZY HERE!! ok peace is spoken :)
My PHP version is: 4.3.8
SQL version: 4.0.20-standard
// check to make sure application was filled out
if ($_POST[hackcheck] == "okie doke") {
//form the email
$msg = "Name: $_POST[realname]\n";
$msg .= "Birthdate: $_POST[bdate]\n";
$msg .= "Current Nick: $_POST[currentnick]\n";
$msg .= "Desired Nick: $_POST[desirednick]\n";
$msg .= "Email: $_POST[email]\n";
$msg .= "Location: $_POST[locale]\n";
$msg .= "Time Zone: $_POST[timezone]\n";
$msg .= "I prefer to play $_POST[preftour] tournaments.\n\n";
$msg .= "I use $_POST[iuse] messenger the most.\n";
$msg .= "My MSN Addy is: $_POST[msnnick]\n";
$msg .= "My Y! nick is: $_POST[yahoonick]\n";
$msg .= "My AIM nick is: $_POST[aimnick]\n";
$msg .= "MY ICQ nick is: $_POST[icqnick]\n\n";
$msg .= "Do I have a plus nick? $_POST[haveplus]\n";
if ($_POST[haveplus] == "yes") {
$msg .= " My plus nick is: $_POST[plusnick]\n";
}
$msg .= "\n";
$msg .= "Have I belonged to any other teams in the past? $_POST[prevteam]\n";
if ($_POST[prevteam] == "yes") {
$msg .= "The teams were: $_POST[prevteams]\n";
}
$msg .= "\n";
$msg .= "I know the following RS Artists:\n";
$msg .= "$_POST[knownrs]\n\n";
$msg .= "And a little about me...";
$msg .= "$_POST[bio]\n\n";
// form email headers
$to = "mynameis__jade@hotmail.com";
$subject = "Yet Another RS Application";
$mailheaders = "Application sent from http://www.rockinspaderz.com/html/application.htm";
$mailheaders .= "Please REPLY-TO: $_POST[email]";
// send the email
mail($to, $subject, $msg, $mailheaders) or die("couldn't send email");
// Display Confirmation of email being sent
echo "Your application has been emailed and a member of management will be in contact with you soon to finalize the things that need to be done. Thanks for you interest in the Rockin Spaderz!\n\n\n";
// Create Database Connection
$db_name = "deleted for db protection";
$table_name = "form_applications";
$connection = mysql_connect(localhost, deleted for db protection, deleted for db protection) or die(mysql_error());
$db = mysql_select_db($db_name, $connection);
// Enter the data into the database table
$sql = "INSERT INTO $table_name (realname, desirednick, bdate, locale, timezone, email, iuse, msnnick, yahoonick, aimnick, icqnick, currentnick, preftour, haveplus, plusnick, prevteam, prevteams, knownrs, want2host, bio) VALUES ($_POST[realname], $_POST[desirednick], $_POST[bdate], $_POST[locale], $_POST[timezone], $_POST[email], $_POST[iuse], $_POST[msnnick], $_POST[yahoonick], $_POST[aimnick], $_POST[icqnick], $_POST[currentnick], $_POST[preftour], $_POST[haveplus], $_POST[plusnick], $_POST[prevteam], $_POST[prevteams], $_POST[knownrs], $_POST[want2host], $_POST[bio])";
$result = mysql_query($sql, $connection);
// Display confirmation of database entry
echo "$mysql_query";
} else {
echo "
In order to send the form you must first fill it out.
";}
if you can help PLEASE DO I AM GOING CRAZY HERE!! ok peace is spoken :)
