Code Produces Blank Results - Syntax Error
Posted: Wed Apr 30, 2008 10:03 am
Good Morning,
My form is producing a blank screen with no results. I think its a syntax error. Can anyone please point me in the right direction?
** Thank you all you have helped me thus far.
My form is producing a blank screen with no results. I think its a syntax error. Can anyone please point me in the right direction?
** Thank you all you have helped me thus far.
Code: Select all
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$firstname=$_POST['firstname'];
$lastname=$_POST['lastname'];
$email=$_POST['email'];
$password2 = $_POST['password2'];
$street = $_POST['street'];
$apt = $_POST['apt'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$birthday_month = $_POST['birthday_month'];
$birthday_day = $_POST['birthday_day'];
$birthday_year = $_POST['birthday_year'];
$gender = $_POST['gender'];
$question = $_POST['question'];
$answer = $_POST['answer'];
$answer1 = $_POST['answer1'];
$connect = mysql_connect('ip', 'db', 'password) or die("Unable to Connect to Database<br>".mysql_error());
mysql_select_db('db) or die(mysql_error());
if(isset($username) && isset($password) && isset($password2) && ($answer) && ($answer1))
{
if($password != $password2){
echo "Password do not match\n";
}
if(strlen($password) < 6 || strlen($password) > 64){
echo "Password is either too short or too long\n";
}
if($answer != $answer1){
echo "Answers do not match\n";
}
else{
mysql_query("INSERT INTO users (username, password,firstname, lastname, email, password2, street, apt, city, state, zip, phone, birthday_month, birthday_day, birthday_year, gender, question, answer, answer1) VALUES ('$username','$password','$firstname','$lastname','$email','$password2','$street','$apt','$city','$state','$zip','$phone','$birthday_month','$birthday_day', '$birthday_year','$gender','$question','$answer','$answer1')") or die(mysql_error());
echo "Your Information has been successfully added to the database. Thank you for your registration";
}
}
mysql_close($connect) or die("Unable to Close Database<br>".mysql_error());
?>