Hi!,
I wrote a simple script that’s receives an POST array from an HTML form,
Runs a line of simple checks, and inserts the a fresh user profile to the data base, in ideal…
But it just won’t work, it won’t even returns an error(it should tho)…
can some one just take a look at the phrase, I’m sure that my mistake quite nublsih, and wouldn’t take much of an effort to trace it…
Thanks in advance…
[code=php]<?php
If($_SERVER[‘HTTP_REFERER’]=$_SERVER[‘PHP_SELF’] or isset($_POST[‘check’]))
{
if(isset($_POST[‘name’]) and isset($_POST[‘name2’]) and isset($_POST[‘password’]) and isset($_POST
[‘password2’]) and isset($_POST[‘mail’]) and isset($_POST[‘mail2’]))
{
$link=mysql_connect(“127.0.0.1”, “root”, “”) or die(mysql_error());
mysql_select_db(“users”, $link) or die(mysql_error());
if(strcmp($password, $password2)!=0)
{
$submit=0;
$message=”The passwords you entered doesn’t match.”;
}
if(strcmp($mail1, $mail)!=0)
{
$submit=0;
$message=$message.”<br>The email addresses you have entered doesn’t match.”;
}
if(submit!=0)
{
$results=mysql_query(“INSERT INTO users(name, password, date, msn, icq, email)
VALUES(“.$_POST[‘name’].”, “.md5($_POST[‘password’]).”, “. time().”,”.$_POST[‘msn
‘].”, “.$_POST[‘icq’].”,
“.$_POST[’email’].”)”, $link) or die(mysql_error());
print(“jarjar”);
}
print($message);
if(!isset($submit))
print(“Success!”);
}
}
?>
<!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=”text” dir=”rtl” align=”right” name=”password” maxlength=”20″ /></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=”text” dir=”rtl” align=”right” name=”password2″ maxlength=”30″ /></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>