$username = $HTTP_POST_VARS["username"];
$password = $HTTP_POST_VARS["password"];
$pass_conf = $HTTP_POST_VARS["pass_conf"];
$email = $HTTP_POST_VARS["email"];
$conf_email = $HTTP_POST_VARS["conf_email"];
$first = $HTTP_POST_VARS["first"];
$last = $HTTP_POST_VARS["last"];
if((!$username) || (!$password) || (!$email) || (!$first) || (!$last)){
header("Location: http://65.30.118.253/signup_parser.php?error=1");
exit;
}
if($password != $pass_conf){
header("Location: http://65.30.118.253/sign_up.html");
exit;
}
if($email != $conf_email){
header("Location: http://65.30.118.253/sign_up.html");
exit;
}
function valid_email($address){
if(ereg("[a-zA-Z0-9_]+@[a-zA-Z0-9-]+.[a-zA-Z0-9\=.]+$", $address))
return true;
else
return false;
}
if(!valid_email($email)){
header("Location: http://65.30.118.253/sign_up.html");
exit;
}
$db_name = "mlm";
$table_name = "users";
$connection = mysql_connect("65.30.118.253", "blahblah", "a071584a") or die(mysql_error());
$db = mysql_select_db($db_name, $connection) or die("Couldn't select database.");
$sql = "
SELECT * FROM $table_name
WHERE username = \"$username\"
";
$result = mysql_query($sql, $connection) or die(mysql_error());
$num = mysql_numrows($result);
if($num != 0){
header("Location: http://65.30.118.253/sign_up.html");
exit;
}
$sql_two = "
INSERT INTO $table_name
(username, password, email, first, last)
VALUES
(\"$username\", \"$password\", \"$email\", \"$first\", \"$last\")
";
$result = mysql_query($sql_two, $connection) or die(mysql_error());
The above is my code.
I am running Apache on a Windows XP platform. I have the mysql directory shared but still nothing I can't figure this one out guy's any help would be greatly appeciated.