Hi guys, sorry, I've got a parse error!
I have had a look through a lot of other posts about it but I've counted the brackets and I think they match up. I also downloaded PSPad but couldn't really figure out how to use it. The error is
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\penetpaper\regcheck.php on line 152
<!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Registration Check</title>
<?php
$url = 'thanks.php\';
$username2 = $_POST[\'username\'];
$password2 = $_POST[\'password\'];
$repeatpassword2 = $_POST[\'password2\'];
$email2 = $_POST[\'email\'];
$firstname2 = $_POST[\'name\'];
$lastname2 = $_POST[\'lastname\'];
$dobmonth2 = $_POST[\'dobmonth\'];
$dobday2 = $_POST[\'dobday\'];
$dobyear2 = $_POST[\'dobyear\'];
$country2 = $_POST[\'country\'];
if (($password)!=($password2))
{
header("Location: sorrypass.php");
Die();
}
function CheckMail($email)
{
if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$",$email))
{
return true;
}
else
{
return false;
}
}
if ((empty($email)) || (!CheckMail($email)))
{
header("Location: emptyemail.php");
Die();
}
if (empty($username))
{
header("Location: emptyusername.php");
Die();
}
if (empty($password))
{
header("Location: emptypassword.php");
Die();
}
if (empty($password2))
{
header("Location: emptyrepeatpassword.php");
Die();
}
if (empty($firstname))
{
header("Location: emptyfirstname.php");
Die();
}
if (empty($lastname))
{
header("Location: emptylastname.php");
Die();
}
$min_lenngth = 6;
if(strlen($username) < $min_lenngth || strlen($password) < $min_lenngth)
{
header("Location: lengthuserpass.php");
Die();
}
$max_lenngth = 20;
if(strlen($username) > $max_lenngth || strlen($password) > $max_lenngth)
{
header("Location: lengthuserpass.php");
Die();
}
{
mysql_select_db($database_connect, $connect);
$Result1 = mysql_query($insertSQL, $connect) or die(mysql_error());
}
$check = mysql_query("select username from users where username=\"$username\"");
$returned = mysql_fetch_array($check);
if(!empty($returned))
{
header("Location: userexists.php");
mysql_close($connection);
Die();
}
else
{
$check = mysql_query("select email from users where email=\"$email\"");
$returned = mysql_fetch_array($check);
if(!empty($returned))
}
{
header("Location: emailexists.php");
mysql_close($link);
Die();
}
else
{
$password=md5($password);
$request = "INSERT INTO users values(NULL,\'$firstname\',\'$username\',\'$password\', \'$email\',\'$lastname\',\'$dobmonth\',\'$dobday\',\'$dobyear\',\'$country\')";
}
$results = mysql_query($request);
if($results)
{
header("Location: thanks.php");
}
else
{
header("Location: sorryaccount.php");
}
{
mysql_close($link);
Die();
}
?>
</head>
echo;
?>
</head>
<body>
</body>
</html>
Cheers, sorry again if its something stupid that I've missed, it is 4am though! lol