PHP Code:
<?
if($_SESSION[UserID] <> "")
{
SetTitle("Message from System", array("Log out first if you want to create another account"));
header("Location: index.php");
die();
}
if(isset($_POST[submit]))
{
$user = clean($_POST[userid]);
$pass[0] = clean($_POST[pass1]);
$pass[1] = clean($_POST[pass2]);
$email = clean($_POST[email]);
$sq = clean($_POST[sq]);
$sa = clean($_POST[sa]);
if($pass[0] != $pass[1]){
SetTitle("Register", array("The passwords do not match"));
header("Location: index.php?do=register");
die();
}
elseif ( mssql_num_rows( mssql_query_logged("SELECT * FROM Account(nolock) WHERE UserID = '$user'") ) <> 0 ){
SetTitle("Register", array("The UserID $userid is already in use"));
header("Location: index.php?do=register");
die();
}
elseif ( mssql_num_rows( mssql_query_logged("SELECT * FROM Account(nolock) WHERE Email = '$email'") ) <> 0 ){
SetTitle("Register", array("The Email $email is already in use"));
header("Location: index.php?do=register");
die();
}
elseif ($user == ""){
SetTitle("Register", array("Please enter an UserID"));
header("Location: index.php?do=register");
die();
}
elseif ($pass[0] == "" || $pass[1] == ""){
SetTitle("Register", array("Please enter a password"));
header("Location: index.php?do=register");
die();
}
elseif ($email == ""){
SetTitle("Register", array("Please enter an email"));
header("Location: index.php?do=register");
die();
}
elseif ($sq == ""){
SetTitle("Register", array("Please enter a secret question"));
header("Location: index.php?do=register");
die();
}
elseif ($sa == ""){
SetTitle("Register", array("Please enter a secret answer"));
header("Location: index.php?do=register");
die();
}
elseif (strlen($user) < 6){
SetTitle("Register", array("The userid is too short (6 chars min)"));
header("Location: index.php?do=register");
die();
}
elseif (strlen($pass[0]) < 6){
SetTitle("Register", array("The password is too short (6 chars min)"));
header("Location: index.php?do=register");
die();
}
else{
$query = sprintf("EXECUTE spWebHGCreateAccount '%s', '%s', '%s', '%s', '%s', '%s'", $user, $pass[0], $email, $sq, $sa, $loginhash);
mssql_query_logged($query);
SetTitle("Register", array("The account $user has been created successfully"));
header("Location: index.php");
die();
}
}else{
SetTitle("Gunz - Register");
/* $europe = array('DE','AT','BG','BE','CY','DK','SK','SI','ES','EE','FI','FR','GR','HU','IE','LV','LT','LU','MT','NL','PL','PT','GB','CZ','RO','SE');
$p = GetCountryCodeByIP($_SERVER[REMOTE_ADDR]);
if(in_array(strtoupper($p), $europe))
{
$country = sprintf("[<font color='#00FF00'>%s</font>] %s", $p, GetCountryNameByIP($_SERVER[REMOTE_ADDR]));
}else{
$country = sprintf("[<font color='#FF0000'>%s</font>] %s", $p, GetCountryNameByIP($_SERVER[REMOTE_ADDR]));
}*/
}
?>
<body onload="FP_preloadImgs(/*url*/'../images/btn_register_on.png')">
<table border="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="183" valign="top">
<div align="center">
<? include "blocks/block_ranking.php" ?>
</div>
</td>
<td valign="top">
<div align="center">
<table border="1" style="border-collapse: collapse" width="100%" bordercolor="#000000">
<tr>
<td background="images/content_bar.png" height="24" style="background-image: url('images/content_bar.png'); background-repeat: no-repeat; background-position: center top">
<div align="center">
<font face="Tahoma" size="2"><b> Register an Account at GunZ</b></font></td>
</tr>
<tr>
<td bgcolor="#2C2A2A">
<div align="center">
<form method="POST" action="index.php?do=register" name="register">
<table border="0" style="border-collapse: collapse; float:left" width="408" height="100%">
<tr>
<td width="401" colspan="5" style="background-image: url('images/mis_eumember.png'); background-repeat: no-repeat; background-position: center top" height="62">
<div align="center">
<table border="0" style="border-collapse: collapse" width="404" height="100%">
<tr>
<td width="11"> </td>
<td width="378">
<p align="center">
<font color="#FF0000">
NOTE:</font> The Administrator(s) or the Staff of GunZ will "Never" ask for your Password.</font></td>
<td width="9"> </td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="183"> </td>
<td width="183"> </td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9" id="img13"></td>
<td width="183" align="left">
<div align="left"><b>UserID</b> :</td>
<td width="183" align="left">
<input type="text" name="userid" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9"></td>
<td width="183" align="left">
<b>Password</b> :</td>
<td width="183" align="left">
<input type="password" name="pass1" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9"></td>
<td width="183" align="left">
<b>Repeat the Password</b> :</td>
<td width="183" align="left">
<input type="password" name="pass2" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9"></td>
<td width="183" align="left">
<b>E-Mail</b> :</td>
<td width="183" align="left">
<input type="text" name="email" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="183" align="left"> </td>
<td width="183" align="left"> </td>
<td width="16"> </td>
</tr>
<tr>
<td width="402" colspan="5">
<p align="center">
<img border="0" src="images/mis_sepline.png" width="391" height="2"></td>
</tr>
<tr>
<td width="402" colspan="5" background="images/mis_eumember.png" height="62" style="background-image: url('images/mis_eumember.png'); background-repeat: no-repeat; background-position: center top">
<div align="center">
<table border="0" style="border-collapse: collapse" width="404" height="100%">
<tr>
<td width="11"> </td>
<td width="378">
<p align="center"><font color="#FF0000">NOTE:</font> The Secret Q / A are used to Recove your Password.</td>
<td width="9"> </td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="183" align="left"> </td>
<td width="183" align="left"> </td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9"></td>
<td width="183" align="left">
<b>Secret Question</b> :</td>
<td width="183" align="left">
<input type="text" name="sq" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9">
<img border="0" src="images/mis_arrow.png" width="5" height="9"></td>
<td width="183" align="left">
<b>Secret Answer</b> :</td>
<td width="183" align="left">
<input type="text" name="sa" size="19" class="textLogin"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="183"> </td>
<td width="183"> </td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="366" colspan="2">
<p align="center">
<input border="0" src="images/btn_register_off.png" name="img123" width="136" height="22" onmouseout="FP_swapImgRestore()" onmouseover="FP_swapImg(1,1,/*id*/'img123',/*url*/'images/btn_register_on.png')" type="image"></td>
<td width="16"> </td>
</tr>
<tr>
<td width="11"> </td>
<td width="9"> </td>
<td width="183"> </td>
<td width="183"> </td>
<td width="16"> </td>
</tr>
</table>
<input type="hidden" name="submit" value="1"></form>
</div>
</td>
</tr>
</table>
</div>
</td>
<td width="171" valign="top">
<div align="center">
<? include "blocks/block_login.php" ?>
</div>
</td>
</tr>
</table>
Maybe it's because of that.
PHP Code:
$query = sprintf("EXECUTE spWebHGCreateAccount '%s', '%s', '%s', '%s', '%s', '%s'", $user, $pass[0], $email, $sq, $sa, $loginhash);
Thank you kindly help me.