Hi!, the following code returns this error:
” Parse error: parse error, expecting `T_STRING’ or
The line that the error refers to is marked with an underline.
Nothing i tried so far didn’t help ? .
[code=php]
Code:
<?php
If($_SERVER[‘HTTP_REFERER’]==$_SERVER[‘PHP_SELF’] or isset($_POST[‘check’]))
{
if($_POST[‘name’]!=NULL and $_POST[‘password’]!=NULL and $_POST[‘password2′]!=NULL and
$_POST[’email’]!=NULL and $_POST[’email2′]!=NULL)
{
$meaasge=””;
$submit=1;
function sanitize_input($input)
{
if(get_magic_quotes_gpc())
$input = stripslashes($input);
return(mysql_real_escape_string($input));
}
if($_POST[‘icq’]!=NULL and !is_numeric($_POST[‘icq’]))
{
if($submit==0)
$message=$message.”<br>Please enter an integer number in the “ICQ” field”;
else
$message=”Please enter an integer number in the “ICQ” field”;
$submit=0;
}
$link=mysql_connect(“127.0.0.1”, “root”, “”) or die(mysql_error());
mysql_select_db(“nba”, $link) or die(mysql_error());
if(strcmp($_POST[‘password’], $_POST[‘password2’])!=0)
{
if($submit==0)
$message=$message.”<br>The passwords you entered doesn’t match.”;
else
$message=”The passwords you entered doesn’t match.”;
$submit=0;
}
if(strcmp($_POST[’email’], $_POST[’email2′]) != 0)
{
if($submit==0)
$message=$message.”<br>The email addresses you have entered doesn’t match.”;
else
$message=”The email addresses you have entered doesn’t match.”;
$submit=0;
}
if($submit==1)
{
$query=”INSERT INTO ‘users'(‘name’, ‘password’, ‘date’, ‘msn’, ‘icq’, ’email’)
[U]VALUES(‘$_POST[‘name’]’,’md5($_POST[‘password’])’,’time()’,’$_POST[‘msn’]’, ‘$_POST[‘icq’]’,’$_POST[’email’]’)”;[/U]
$results=mysql_query($query, $link) or die(mysql_error());
print(“$results”);
print(“success”);
}
}
else
print(“Please fill out all the fields marked with “*””);
if(isset($message))
print($message);
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=” />
<title>Untitled Document</title>
</head>
<body>
<form method=”post” action=”<?php print($_SERVER[‘PHP_SELF’]);?>”>
<table width=”70%” border=”0″ cellspacing=”1″ cellpadding=”0″ align=”right” dir=”rtl”>
<tr>
<td width=”20%”>User name*</td>
<td width=”30%”><input type=”text” dir=”rtl” align=”right” name=”name” maxlength=”12″ /></td>
<td width=”20%”>Retype E-mail* </td>
<td><input type=”text” dir=”rtl” align=”right” name=”email2″ maxlength=”30″ /></td>
</tr>
<tr>
<td>password*</td>
<td><input type=”password” dir=”rtl” align=”right” name=”password” maxlength=”20″ size=””/>
</td>
<td width=”20%”>Msn messengr ID</td>
<td><input type=”text” dir=”rtl” align=”right” name=”msn” maxlength=”20″ /></td>
</tr>
<tr>
<td>retype password*</td>
<td><input type=”password” dir=”rtl” align=”right” name=”password2″ maxlength=”20″ /></td>
<td>ICQ number </td>
<td><input type=”text” dir=”rtl” align=”right” name=”icq” maxlength=”12″ /></td>
</tr>
<tr>
<td width=”20%”>Contact E-mail*</td>
<td><input type=”text” dir=”rtl” align=”right” name=”email” maxlength=”30″ /> </td>
</tr>
<tr><td><input type=”submit” dir=”rtl” align=”right” value=”send” /></td></tr>
</table>
<input type=”hidden” name=”check” value=”1″ />
</form>
</body>
</html>
Screenshot of the DB:
[url]http://img355.imageshack.us/img355/3729/shot4tw.jpg