Sorry; I'm very new to PHP. 🙁
That error is fixed, but now I seem to be having a problem with the SQL. This is the error I'm getting:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/noom/public_html/register.php on line 29
And here is the whole PHP file. I didn't think a simple little registration form would be so much trouble. @.x
<?php
// connect to database
$con = mysql_connect("localhost","noom_rpg","");
if (!$con)
{
die ("Could not connect to database.");
}
// get the register info
$register = array("username"=>$_POST['username'],
"password"=>$_POST['username2'],
"password2"=>$_POST['password2'],
"email"=>$_POST['email'],
"email2"=>$_POST['email2']);
if ($register)
{
if(preg_match('/[^0-9A-Za-z]/',$register['username']))
{
if(filter_var($register['email'], FILTER_VALIDATE_EMAIL))
{
mysql_select_db("noom_users", $con);
mysql_query("INSERT INTO users (username, password, email)
VALUES ('$register['username']', '$register['password']', '$register['email']')");
echo "You have successfully registered an account. You may now login to Auraelia!";
}
else
{
echo "Please return and use an acceptable email address.";
}
}
else
{
echo "Please return and use only alphanumeric characters in your username.";
}
}
else
{
echo "Please return and fill out the entire registration form!";
}
mysql_close($con);
?>