<?php
$uname = $_POST['username'];
$pword = $_POST['password'];
$cpass = $_POST['confirmpass'];
$email = $_POST['email'];
$probs = $_POST['prob'];
if($probs != "10")
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The answer to the problem was incorrect, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
elseif($probs == "10")
{
if($uname != "" && $pword != "" && $cpass != "" && $email != "")
{
if($pword == $cpass)
{
$register = mysql_query("SELECT * FROM `users`");
while($reg = mysql_fetch_array($register ))
{
if("{$reg['username']}" == $uname)
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The username you have entered was already taken, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
else
{
if("{$reg['password']}" == $pword)
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The passwords you have entered are already taken, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
else
{
if("{$reg['eamil']}" == $email)
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The email you have entered is already taken, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
elseif("{$reg['username']}" != $uname && "{$reg['password']}" != $pword && "{$reg['email']}" != $email)
{
$date = date('Y-m-d H:i:s');
mysql_query("INSERT INTO `users` ( `username` , `password` , `email` , `group` , `logo` , `warnings` , `reg_date` )
VALUES ('$_POST[username]', '$_POST[password]', '$_POST[email]', 'Member', 'sources/style_images/green/logo.jpg', '0', '$date' )");
echo "<script>
window.location = '?page=login&CODE=001';
</script>";
}
}
}
}
}
elseif($pword != $cpass)
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The passwords you entered didn't match, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
}
else
{
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="82" class="textseg"><div style='font-weight:bold; font-size:18px;'>Registration Error</div>
<br />
<br />
The form was not accepted, please go back and try again!<br />
<br />
<div align="right"><<a href="javascript: history.back()" title="Go back!">BACK</a>>
</div></td>
</tr>
</table>
}
}
?>(FYI: Where you see PLAIN HTML I had ending PHP tags, but I had to remove them to post.
I'm trying to make a site that it going perfectly accept for the registration part. It's adding more than one row on one registration, and the number that is added is only doubled hear's a more graphic explanation.
2 accounts already registered
On the next registration 2 more account are added with all of the same detailed information.