Jump to content

Website register wont work.


Corlet

Recommended Posts

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"); ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.