Fashong
06-16-2005, 01:23 PM
The problem is I can signup more then once, I don't know what is wrong in my coding but if their is more then one ip in the users it shouldn't let them signup. Also, if I goto that page, even without hitting submit it says "You can not make more then one account!".
Please help
<?php
$title = "Signup";
include("top.php");
$IP = $_SERVER['REMOTE_ADDR'];
?>
<div id="content">
<span>Signup</span>
<p>
<form method="POST" action="signup.php?action=signup">
Username:<br> <input type="text" name="username" size="20" maxlength="15"><br>
Password:<br> <input type="password" name="password" size="20" maxlength="15"><br>
Verify Password:<br> <input type="password" name="verpassword" size="20" maxlength="15"><br>
Email:<br> <input type="text" name="email" size="20" maxlength="25"><br><br>
Note: Your ip will be logged so please do not make multiple accounts<br><br>
<input type="submit" name="action" value="Signup"></form>
<?php
$ipcheck = mysql_query("select * from users where IP='$IP'");
IF(@mysql_numrows($ipcheck) > 0){
$ipused = yes;
}else{
$ipused = no;
}
IF ($action == "Signup" && $ipused == "no"){
$userupdate = mysql_query("INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES ('', '$username', '$email', '$password', '', '$IP', '')");
echo "Thank you for signing up.";
}else{
echo "You can not make more then one account!";
}
?>
</div>
<?php
include("bottom.php");
?>
Please help
<?php
$title = "Signup";
include("top.php");
$IP = $_SERVER['REMOTE_ADDR'];
?>
<div id="content">
<span>Signup</span>
<p>
<form method="POST" action="signup.php?action=signup">
Username:<br> <input type="text" name="username" size="20" maxlength="15"><br>
Password:<br> <input type="password" name="password" size="20" maxlength="15"><br>
Verify Password:<br> <input type="password" name="verpassword" size="20" maxlength="15"><br>
Email:<br> <input type="text" name="email" size="20" maxlength="25"><br><br>
Note: Your ip will be logged so please do not make multiple accounts<br><br>
<input type="submit" name="action" value="Signup"></form>
<?php
$ipcheck = mysql_query("select * from users where IP='$IP'");
IF(@mysql_numrows($ipcheck) > 0){
$ipused = yes;
}else{
$ipused = no;
}
IF ($action == "Signup" && $ipused == "no"){
$userupdate = mysql_query("INSERT INTO users (id, username, email, password, status, ipaddress, age) VALUES ('', '$username', '$email', '$password', '', '$IP', '')");
echo "Thank you for signing up.";
}else{
echo "You can not make more then one account!";
}
?>
</div>
<?php
include("bottom.php");
?>