I recently used a code for a very basic account creation page from MMOwned(i would have asked the question on that thread but could not as the thread was too old) and I am getting an error that says "Parse error: syntax error, unexpected T_STRING in /home/wowrequ1/public_html/home.php on line 18"
and after searching around on the web for a fix to this, I figure that its either that I'm using an old PHP(not completely sure what that means, but thats what other people with similar issues were told on various boards) in which case could i get help in changing into the proper php? or there is simply some small thing im missing (common ones were ";" (}) or (")) After looking through it trying several things i could not find out what was wrong, as I am fairly new to php code.
Here is my home.php code
PHP Code:
<html>
<body>
<?php
error_reporting(E_ALL);
$name = $_POST['username'];
$pass = $_POST['password'];
$email = $_POST['email'];
$flags=0;
if(!empty($_POST['TBC'])){
$flags+=8;
}
if(!empty($_POST['WotLK'])){
$flags+=24;
}
mysql_connect("ipaddress","user","password");
mysql_select_db("accounts");
if(mysql_num_rows(mysql_query("SELECT * FROM `accounts` WHERE `login`= '".$name."'))>0){
echo"Please Choose another Username.";
}else{
if(mysql_query("INSERT INTO accounts (login, password, email,flags) VALUES('$name', '$pass', '$email', '$flags' )")){
echo"Your Account has been created Successfully";
}else{
echo"Please Try Again.";
}
}
?>
</body>
</html>
Any help is appreciated!
Thanks!