YAY alright, I semm to have cleared all but 1 parse error. This one throws me off and I just can't think of anything so please HELP!
on line 120 which is the php closing tag its giving me a parse error please tell me what the heck that could be!
<?php
include_once "functions.php";
connect();
if(!$_POST['submit']){
echo "<table border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n";
echo "<form method=\"post\" action=\"register.php\">n";
echo "<tr><td colspan=\"2\" align=\"center\">Registration Form</td></tr>\n";
echo "<tr><td>KeyIDentitY</td><td><input type=\text\" name=\username\"></td></tr>\n";
echo "<tr><td>Password</td><td><input type=\password\" name=\password\"></td></tr>\n";
echo "<tr><td>Confirm</td><td><input type=\password\" name=\passconf\"></td></tr>\n";
echo "<tr><td>Email</td><td><input type=\text\" name=\email\"></td></tr>\n";
echo "<tr><td>First Name</td><td><input type=\text\" name=\fname\"></td></tr>\n";
echo "<tr><td>Last Name</td><td><input type=\text\" name=\lname\"></td></tr>\n";
echo "<tr><td>Phone Number</td><td><input type=\text\" name=\phone\"></td></tr>\n";
echo "<tr><td>BBPin</td><td><input type=\text\" name=\bbpin\"></td></tr>\n";
echo "<tr><td>Age</td><td><input type=\text\" name=\age\"></td></tr>\n";
echo "<tr><td>Gender</td><td><input type=\text\" name=\gender\"></td></tr>\n";
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" name=\"submit\" value=\"Register\"></td></tr>\n";
echo "</form></table>\n";
}else {
$username = protect($_POST['username']);
$password = protect ($_POST['password']);
$confirm = protect ($_POST['passconf']);
$email = protect ($_POST['email']);
$fname = protect ($_POST['fname']);
$lname = protect ($_POST['lname']);
$bbpin = protect ($_POST['bbpin']);
$age = protect ($_POST['age']);
$gender = protect ($_POST['gender']);
$errors = array();
if(!$username){
$errors[] = "Username is not defined!";
}
if(!$password){
$errors[] = "Password is not defined!";
}
if($password){
if(!$confirm){
$errors[] = "Confirm password is not defined!";
}
}
if(!$email){
$errors[] = "Email is not deifned";
}
if(!$fname){
$errors[] = "First name is not deifned";
}
if(!$lname){
$errors[] = "Last Name is not deifned";
}
if(!$bbpin){
$errors[] = "BBPin is not deifned";
}
if(!$age){
$errors[] = "Age is not deifned";
}
if(!$gender){
$errors[] = "Gender is not deifned";
}
if($username){
if(!ctype_alnum($username)){
$errors = "username can only contain numbers and letters!";
}
if($password && $confirm){
if($password != $confirm){
$errors[] = "Passwords do not match!";
}
}
if($email){
$checkemail = "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2.}$/1";
if(!preg_match($checkemail, $email)){
$errors[] = "E-mail is not valid, must be name@yourserver.tld!";
}
}
if($username) {
$sql - "SELECT * FROM users WHERE 'username'='($username)'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) > 0){
$errors[] = "The username you entered is already in use";
}
}
if($email){
$sql2 = "SELECT * FROM users WHERE 'email'='($email)'";
$res2 = mysql_query($sql2) or die(mysql_error());
if(mysql_num_rows($res2) >0){
$error[] = "The email you entered is already in use";
}
}
if(count($errors) > 0){
foreach($errors AS $error){
echo $error . "<br>\n";
}
}else {
$sql4 = "INSERT INTO 'users'
('username','password','email')
('$username','".md5($password)."','$email');";
$res4 = mysql_query($sql4) or die(mysql_error());
echo "You have successfully registered with the username <b>($username) </b> and password <b> ($password) </b>";
}
?>