Corlet Posted December 9, 2007 Share Posted December 9, 2007 I downloaded a open source php game script and the signup doesnt work. When you enter your details and click register it just refreshses the page and doesn register your account. I dont know what information to paste here for anyone to see whats wrong with it because I cant do scripting myself, but I know a tiny bit from editing them. Heres the sign up form, if you need any other pages just add a comment. <?php include("head.php"); ?> <center>name</center> <form method=post action=signup.php?action=register> <table> <tr><td>Username:</td><td><input type=text name=user></td></tr> <tr><td>Email:</td><td><input type=text name=email></td></tr> <tr><td>Pass:</td><td><input type=password name=pass></td></tr> <tr><td>Verify Pass:</td><td><input type=password name=vpass></td></tr> <tr><td colspan=2 align=center><input type=submit value=register></td></tr> </table> </form> <?php if ($action == register) { if (!$user || !$pass || !$email || !$vpass ) { print "You must fill out all fields."; include("foot.php"); exit; } $dupe1 = mysql_num_rows(mysql_query("select * from players where user='$user'")); if ($dupe1 > 0) { print "Someone already has that username."; include("foot.php"); exit; } $dupe2 = mysql_num_rows(mysql_query("select * from players where email='$email'")); if ($dupe1 > 0) { print "Someone already has that email."; include("foot.php"); exit; } if ($pass != $vpass) { print "The passwords do not match."; include("foot.php"); exit; } $ip = "$HTTP_SERVER_VARS[REMOTE_ADDR]"; $ipcheck = mysql_num_rows(mysql_query("SELECT * FROM players WHERE IP = '$ip'")); if ($ipcheck > 0) { Print "You can only have 1 account per person."; include("foot.php"); exit; } $x = strip_tags($ref); $user = strip_tags($user); $pass = strip_tags($pass); mysql_query("insert into players (user, email, pass) values('$user','$email','$pass')") or die("Could not register."); print "You are now registered to play, $user. Please login now."; } ?> <?php include("foot.php"); ?> Quote Link to comment Share on other sites More sharing options...
marcus Posted December 9, 2007 Share Posted December 9, 2007 $action is not defined. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 Do you have register globals turned on? If not, you need to change the variables that depend on it to $_POST and $_GET Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.