Results 1 to 8 of 8

Thread: Wth ?

  1. #1
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default Wth ?

    I quickly put together a register script for my clan site, but when i register the email inputs as 0 but no error ?

    PHP Code:
    <?PHP 
    session_start
    ();
    require(
    'includes/config.php');

    if(!
    $_POST[register]){
        echo(
    '
        <form method="POST">
        Username: <input type="text" size="15" maxlength="25" name="username"><br />
        Password: <input type="password" size="15" maxlength="25" name="pass"><br />
        Confirm Password: <input type="password" size="15" maxlength="25" name="cpass"><br />
        Email: <input type="text" size="15" maxlength="25" name="emai1"><br />
        Age: <input type="text" size="15" maxlength="25" name="age"><br />
        Location: <input type="text" size="15" maxlength="25" name="location"><br />
        Gamertag: <input type="text" size="15" maxlength="25" name="gt"><br />

        <input name="register" type="submit" value="Register">
        </form>'
    );

    }else{

    $username $_POST[username];
    $password $_POST[pass];
    $cpassword $_POST[cpass];
    $email $_POST[emai1];
    $age $_POST[age];
    $location $_POST[location];
    $gt $_POST[gt];

        if(
    $username == NULL $password == NULL $cpassword == NULL $email NULL $age == NULL $location == NULL $gt == NULL){
        echo(
    'A field was left blank, please fill in all fields!');
        }else{
            if(
    $password != $cpassword){
            echo(
    'Passowrds do not match!');
            }else{
                
    $password md5($password);
                
    $checkname mysql_query("SELECT username FROM users WHERE username='$username'");
                
    $checknamemysql_num_rows($checkname);
                
    $checkemail mysql_query("SELECT email FROM users WHERE email='$email'");
                
    $checkemail mysql_num_rows($checkemail);
                    
                        if (
    $checkemail>0|$checkname>0) {
                        echo(
    'Someone already has that username, or email!');
                        }else{
                    
                        
    $query mysql_query("INSERT INTO users (username, password, email, age, location, gamertag) VALUES('$username','$password','$email', '$age', '$location', '$gt')");
                        echo(
    'Successfully registerd!');
                        }
                }
            }
        }

    ?>
    James


    Connected to reality through a proxy server.

  2. #2
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    Edit: I'm A Muppet!
    Last edited by Drompo; 03-07-2007 at 07:35 PM.


  3. #3
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Its meant to be like that, lol.Look at the form, muppet. Thanks anyway ash.
    James


    Connected to reality through a proxy server.

  4. #4
    Join Date
    Mar 2005
    Location
    Leeds
    Posts
    3,423
    Tokens
    0

    Latest Awards:

    Default

    You need to add some more security before releasing that.

  5. #5
    Join Date
    Feb 2005
    Location
    Leicestershire / Sheffield
    Posts
    685
    Tokens
    0

    Default

    if($username == NULL | $password == NULL | $cpassword == NULL | $email = NULL | $age == NULL | $location == NULL | $gt == NULL){

    you have a single = on the email part

  6. #6
    Join Date
    Jan 2007
    Posts
    825
    Tokens
    0

    Default

    True + Rep
    That post was really sensible!

  7. #7
    Join Date
    Jul 2007
    Location
    Liverpool
    Posts
    131
    Tokens
    0

    Default

    PHP Code:
    echo('Successfully registerd!'); 

    Spelling lol

    I see no problems with the script. Except for the single '='


  8. #8
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Thanks, and its not going to be released.Just testing it really.
    James


    Connected to reality through a proxy server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •