I keep getting this on my registration page when i press the submit button! The code is provided under the error:
Notice: Undefined index: TermsOfService in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 5
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 6
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 6
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 7
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 7
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 8
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 8
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 9
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 9
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 10
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\Documents and Settings\Administrator\My Documents\Xampp\htdocs\RegisterPage.php on line 10
Unknown database 'civilian'
<?php
error_reporting(E_ALL);
if (isset($_POST['RegistrationSubmission'])) {
$TermsOfService = $_POST['TermsOfService'];
$Username = mysql_real_escape_string($_POST['Username']);
$Password = mysql_real_escape_string($_POST['Password']);
$Password2 = mysql_real_escape_string($_POST['Password2']);
$Email = mysql_real_escape_string($_POST['EmailRegistration']);
$Country = mysql_real_escape_string($_POST['CountryChoice']);
$ip = $_SERVER["REMOTE_ADDR"];
$Gender = $_POST['Gender'];
$jump2 = 1;
if ($Password != $Password2) {
echo "Passwords did not match";
if ($TermsOfService == "off") {
echo "You must agree to the terms of service before registering!";
$jump2 = 0;
}
}
if ($jump2 ==1){
mysql_connect("localhost", "root", "private") or die (mysql_error());
mysql_select_db("civilian") or die (mysql_error());
$chkUSERNAME = mysql_query("SELECT * FROM `userregistration` WHERE `Username` = '".$_POST['Username']."'");
$getUSERNAME = mysql_fetch_object($chkUSERNAME);
if($_POST['Username'] == $getUSERNAME->Username) {
die('Username already registered, please choose a different username!');
}
$chkEmail = mysql_query("SELECT * FROM `userregistration` WHERE `Email` = '".$_POST['EmailRegistration']."'");
$getEmail = mysql_fetch_object($chkEmail);
if($_POST['EmailRegistration'] == $getEmail->Email) {
die('Email already registered, please choose a different username!');
}
if ($Password == $Password2) {
mysql_connect("localhost", "root", "private") or die (mysql_error());
mysql_select_db("civilian") or die (mysql_error());
$query = "INSERT INTO `userregistration` (Username,Password,Email,Country,IP,Gender)
Values ('$Username', '$Password', '$Email', '$Country', '$ip', '$Gender')";
mysql_query($query) or die(mysql_error());
}
}
}
?>
Can any one see my problem ive made :S?