if (file_exists("vars.php")):
include("vars.php");
endif;
if (file_exists("header.php")):
include("header.php");
endif;
?>
if ($register == "yes"):
$name = ereg_replace("\"",""",$name);
$city = ereg_replace("\"",""",$city);
$country = ereg_replace("\"",""",$country);
$descrip = ereg_replace("\"",""",$descrip);
$email=trim($email);
$reg="/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@([a-z0-9-]+\.)*[a-z0-9-]{2,}\.[a-z]{2,}$/i";
$mailok= preg_match($reg,$email);
if ($username == "" || $email == "" || (!$mailok)):
echo "Oops!
Please complete the following fields:
";
else:
$username_check = "$username";
$username_check = ereg_replace("\"","",$username_check);
$username_check = ereg_replace("\"","",$username_check);
$username_check = ereg_replace("\*","",$username_check);
$username_check = ereg_replace(" ","",$username_check);
if (file_exists("users/$username.php") || $username_check != "$username"):
echo "Oops!
";
if (file_exists("users/$username.php")):
echo "
I'm sorry, that user name is already taken.
Please choose another one.";
endif;
if ($username_check != "$username"):
echo "
I'm sorry, the username you have chosen contains characters you cannot use.
Please do not include spaces, double quotes or stars.";
endif;
echo "";
else:
$passwd = date("sh");
$passwd1 = "$passwd";
$passwd = crypt($passwd, "salt");
if ($url == "http://"):
$url = "";
endif;
$fileMessage = "\n";
$fileMessage .="\$username = \"$username\";\n";
$fileMessage .="\$passwd = \"$passwd\";\n";
$fileMessage .="\$name = \"$name\";\n";
$fileMessage .="\$age = \"$age\";\n";
$fileMessage .="\$sex = \"$sex\";\n";
$fileMessage .="\$email = \"$email\";\n";
$fileMessage .="\$email1 = \"$email1\";\n";
$fileMessage .="\$city = \"$city\";\n";
$fileMessage .="\$country = \"$country\";\n";
$fileMessage .="\$url = \"$url\";\n";
$fileMessage .="\$descrip = \"$descrip\";\n";
$fileMessage .="?>";
$cartFile = fopen("users/$username.php","w+");
fputs($cartFile,$fileMessage);
fclose($cartFile);
$from = "$title <$fromemail>";
$subject = "Your Chat Forum Access Details";
$body = "Your access details are as follows:
User: $username
Pass: $passwd1
We recommend that you go to $myurl,
select \"Edit Profile\" and change your password.
Please retain this email for your future reference.
";
$to = "$email";
mail($to,$subject,$body,"FROM: ".$from);
echo "Success!
Your chosen name was successfully registered and your password has been emailed to
$email.
Please check your email and then login here.
";
endif;
endif;
else:
echo "To use the $title you must first register.
Registration
";
endif;
?>
if (file_exists("footer.php")):
include("footer.php");
endif;
?>