ok ill check the codes you guys sent...but this is my registration code..
<?php require_once('Connections/login.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "register"))
{
if($_POST['textfield2'] == $_POST['textfield3'])
{
$insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, %s)",
GetSQLValueString($_POST['textfield'], "text"),
GetSQLValueString($_POST['textfield2'], "text"));
mysql_select_db($database_login, $login);
$Result1 = mysql_query($insertSQL, $login) or die(mysql_error());
if (isset($_SERVER['QUERY_STRING']))
{
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
$insertGoTo = "good.html";
header(sprintf("Location: %s", $insertGoTo));
} else {
echo 'Your passwords did not match';
}
} ?><!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="register" name="register" method="POST" action="<?php echo $editFormAction; ?>">
<label>Desired Username:<br />
<input type="text" name="textfield" id="textfield" />
</label>
<label><br />
<br />
</label>
<table width="200" border="0" bordercolor="#000000">
<tr>
<td><label> Password:
<input type="password" name="textfield2" id="textfield2" />
</label></td>
</tr>
</table>
<p>
<label>Confim Password:<br />
<input type="password" name="textfield3" id="textfield3" />
</label>
</p>
<p>
<label>E-Mail Verification<br />
<input type="text" name="textfield4" id="textfield4" />
</label>
</p>
<p>
<label>
<input type="submit" name="Register" id="Register" value="Register" />
</label>
</p>
<p> </p>
<input type="hidden" name="MM_insert" value="register" />
</form>
</body>
</html>