Ok i get this parse error for line 66. line 66 is $result2 = insert blah blah.... so maby it will help you find the line. thanks for any help. Here is my code:
<html>
<head>
<link rel="stylesheet" type="text/css" href="eg.css" />
</head>
<body vlink="#c0c0c0">
<?php
if ($submit)
{
if (strlen($username) < 6 || strlen($password) < 6)
{
echo "Username and Password must be atleast 4 characters.\n";
}
else
{
if ($password != $password2)
{
echo "Your passwords did not match!!!!";
}
else
{
if
(ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[.]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$",
$email))
{
// process form when submit is clicked
$db = mysql_connect("localhost", "root");
mysql_select_db("register",$db);
$sql2 = "INSERT INTO members (username, password, sec_que, sec_answer, bmon, bday, byear, fname, lname, zip, gender, email) VALUES
('$username','$password','$sec_que','$sec_answer','$bmon',$bday,$byear,'$fname','$lname',$zip,'$gender','$email')";
$sql = "select username from members where username = '$username'";
$result = mysql_query($sql);
if (mysql_num_rows($result2) > 0)
{
echo "Sorry username taken. Please <a href='register.php'>try again</a>.";
}
else
{
$sql2 = "INSERT INTO members (username, password, sec_que, sec_answer, bmon, bday, byear, fname, lname, zip, gender, email)
VALUES ('$username','$password','$sec_que','$sec_answer','$bmon',$bday,$byear,'$fname','$lname',$zip,'$gender','$email')";
$result2 = mysql_query($sql2);
echo "Thank you for signing up $fname.\n <h3>Now please <a href='login.php'>login</a>!</h3>";
}
else
{
echo "Invalid e-mail, try again";
}
}//ends the else statement for username taken
}//ends the else statement for password dont match
}//ends the else statement for username and password not being 6 chars
}
else
{
// display form before submit button is clicked
?>
<form name="register" method="post" action="<?php echo $PHP_SELF?>">
<h3><b>Login Information</b></h3>
<hr>
<h4>Username:<b>*</b></h4><input type="text" name="username">
<h4>Password:<b>*</b></h4><input type="password" name="password">
<h4>Re-type Password:</h4><input type="password" name="password2">
<br>
<b><h5>(* Must be atleast 6 characters long.)</h5></b>
<br>
<hr>
<br>
<h3><b>Security Information</b></h3>
<br>
<h5>If you forget your password or need help with your account, you will need this information to recieve support.</h5>
<h4>E-Mail:</h4><input type="text" name="email">
<br>
<h4>Security Question:</h4>
<select name="sec_que">
<option value="what city were you born in?">What city were you born in?
<option value="Who was your childhood hero?">Who was your childhood hero?
<option value="What make was your first car?">What make was your first car?
</select>
<br>
<h4>Your answer:</h4><input type="text" name="sec_answer">
<br>
<h4>Birthday:</h4>
<select name="bmon">
<option value="January">January
<option value="February">February
<option value="March">March
<option value="April">April
<option value="May">May
<option value="June">June
<option value="July">July
<option value="August">August
<option value="September">September
<option value="October">October
<option value="November">November
<option value="December">December
</select>
<input type=text name="bday" value="" size=2 maxlength=2> ,
<input type=text name="byear" value="" size=4 maxlength=4 > (Month DD, YYYY)
<br>
<br>
<hr>
<br>
<h3><b>Personal Information</b></h3>
<br>
<br>
<h4>First Name:</h4><input type="text" name="fname">
<h4>Last Name:</h4><input type="text" name="lname">
<h4>Zip Code:</h4><input type="text" name="zip">
<h4>Gender:</h4>
<select name="gender">
<option value="male">Male
<option value="female">Female
</select>
<br>
<br>
<input type="Submit" name="submit" value="Submit">
<input type="Reset" name="reset" value="Reset">
</form>
<?php
} // end if
?>
</body>
</html>