create id_temp table on ur RF_User.dbo.tbl_RFTestAccount
compatible and already tested at rf.gamerzplanet.us running with appserv
compatible and already tested at rf.gamerzplanet.us running with appserv
PHP Code:
<?php echo "<html><head><title>Gamerzplanet</title></head><body>"; ?>
<?php
$this_page = "index.php";
$host = "your ip";
$user = "sa"; //SQL User
$pass = "123456"; //SQL Password
$db = "RF_User"; //Datenbank
?>
<form method="post" action="index.php">
<table border=0>
<tr>
<td width="127">Username</td>
<td width="27">: </td>
<td width="290"><input type=text name="username"/></td>
</tr>
<tr>
<td>Password</td>
<td>: </td>
<td><input type=password name="password" /></td>
</tr>
<tr>
<td>Confirm Password</td>
<td>: </td>
<td><input type=password name="confirm_password" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td><input type="submit" value="submit" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$conn = odbc_connect("Driver={SQL Server Native Client 10.0};Server=$host;Database=$db;", $user, $pass);
$username=$_POST['username'];
$password=$_POST['password'];
$confirm_password=$_POST['confirm_password'];
if ($username!="")
{
$count=0;
$sql = "SELECT * FROM tbl_RFTestAccount WHERE id_temp='$username'";
$rst = odbc_exec($conn,$sql);
while($temp = odbc_fetch_into($rst, &$counter))
{
$count++;
}
if ($count > 0)
{
echo "Sorry, username ".$username." is already been taken....!!";
}
else
{
if($password != $confirm_password)
{
echo "Password and confirm password fields were not matched";
}
else
{
$insert_user = "INSERT INTO tbl_RFTestAccount (id,id_temp,password,BCodeTU) VALUES (CONVERT(binary, '$username'), '$username', CONVERT(binary, '$password'), '1')";
$hasil = odbc_exec($conn, $insert_user);
echo "Registration Successfull...!! Welcome to Gamerzplanet";
}
}
}
odbc_close($conn);
?>