Jump to content

need help with registration from


Renlok

Recommended Posts

ok heres the code for the registration form
[code]
<?php
    include("config.php");
    $user=$_POST['user'];
    $pass=$_POST['pass'];
    $email=$_POST['email'];
    $vpass=$_POST['vpass'];
    $ref=$_POST['ref'];
    $nationality=$_POST['nationality'];
if (!$user || !$pass || !$email || !$vpass || !$nationality ) {
print "You must fill out all fields.";
exit;
}
$query = "select * from players where user='$user'";
         $sql = $db->query($query);
$dupe1 = $sql->num_rows;
if ($dupe1 > 0) {
print "Someone already has that username.";
exit;
}
$query = "select * from players where email='$email'";
         $sql = $db->query($query);
$dupe2 = $sql->num_rows;
if ($dupe2 > 0) {
print "Someone already has that email.";
exit;
}
if ($pass != $vpass) {
print "The passwords do not match.";
exit;
}
$ip = "$HTTP_SERVER_VARS[REMOTE_ADDR]";
        $query = "SELECT * FROM players WHERE ip= '$ip'";
        $sql = $db->query($query);
        $ipcheck = $sql->num_rows;
  if ($ipcheck > 0) {
  Print "You can only have 1 account per person.";
       exit; 
       }
$ref = strip_tags($ref);
$user = strip_tags($user);
$pass = strip_tags($pass);
if ($ref) {
$query = "update players set refs=refs+1 where id='$ref'";
                   $sql = $db->query($query);
            $query = "update players set refd='$ref' where user='$user'";
            $sql = $db->query($query);
}
$msg="Thanks For Registering For World Sporting Game. This Email Contains Inportant Infomration About Your Account.<br><br>
<b>Your Account Information</b><br>
Username: <b>$user</b><br>
Passowrd: <b>$pass</b><br>
<br>
Thanks For Registering From The Team Here At 'The Game'!";

    mail($email,'World Sporting Game Registration',$msg,"From: Admin <[email protected]>\n"."MIME-Version: 1.0\n".      "Content-type: text/html; charset=iso-8859-1");
$query = "insert into players (user,email,pass,country) values ('$user','$email','$pass','$nationality')";
          $sql = $db->query($query);
    if($sql < 0)
    {
    echo 'registration form is currently screwed please contact admin with your problem';
    }
    else
    {
echo "You are now registered to play, $user. Please <a href=index.php>login now</a>."; 
    }
?>
[/code]
and config.php is just the database connection which is
[code]
<?php
mysql_connect("localhost","renlok_renlok","****");
mysql_select_db("renlok_game");
@ $db = mysql_db_connect("localhost","renlok_renlok","****","renlok_game");
if (mysql_connect_error())
{
  echo 'Error: Could not connect to database. Please try again later.';
  exit;
  }
?>
[/code]

meh i cant find the error, plus when you run it, it will just show a blank page.
the link to it is [url=http://www.we-link/game4]http://www.we-link/game4[/url]
Link to comment
https://forums.phpfreaks.com/topic/29104-need-help-with-registration-from/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.