Hello, I just made this user registration script but im a newb and I cant find where my error is. There error is:
Parse error: parse error, unexpected $ in /home/******/public_html/scripts/board/signup.php on line 55
Line 55 is the last line of the script the ?> line?
Here is the whole script (please spot the error and let me know what it is, thank you!):
PHP Code:
<?php
if ($_REQUEST['action'] == "register") {
if ((!$_POST['username']) || (!$_POST['password']) || (!$_POST['vpassword']) || (!$_POST['email_adress'])) {
echo "<b>You did not submit the following information:</b><br />";
if (!$_POST['username']) {
echo "You must enter a username!<br />";
}
if (!$_POST['password']) {
echo "You must enter a password!<br />";
}
if (!$_POST['vpassword']) {
echo "You must verify your password, it must be the same as your password!<br />";
}
if (!$_POST['email_adress']) {
echo "You must enter a email adress!<br />";
}
require("joinform.html");
exit();
} elseif (!$_POST['password'] == $_POST['vpassword']) {
echo "Your password was not the same as the password verification!";
exit();
} else {
include("./include.coz.php");
$username = strip_tags(trim($_POST['username']));
$password = strip_tags(trim($_POST['password']));
$password = md5($password);
$email = strip_tags(trim($_POST['email_adress']));
$query1 = mysql_query("SELECT username from users WHERE username='$username'", $link);
$numrows1 = mysql_num_rows($query1);
$query2 = mysql_query("SELECT email from users WHERE email='$email'", $link);
$numrows2 = mysql_num_rows($query2);
if ($numrows1 > 0) {
echo "Your desired username is already taken. Please try again. Thank you.";
require("joinform.html");
exit();
} elseif ($numrows2 > 0) {
echo "Your desired email adress is already in use by another user. Please try again. Thank you.";
require("joinform.html");
exit();
} else {
$userquery = mysql_query("INSERT INTO users ('username', 'password', 'email', 'signup_date') VALUES ('$username', '$password', '$email', now())");
if (!$userquery) {
echo "Your account could not be created, please contact the webmaster! user_query problem.";
} else {
echo "Congradulations! Your account has been created. Please login.";
}
}
}
require("joinform.html");
?>






)
Bookmarks