Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 5 of 5

Thread: PHP User System

  1. #1
    Join Date
    Sep 2006
    Location
    United Kingdom
    Posts
    667
    Tokens
    0

    Default PHP User System

    http://www.habbostudio.co.uk/members/register.php Cna someone help me everything is working except the register page? Any Help!

  2. #2
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Panther View Post
    http://www.habbostudio.co.uk/members/register.php Cna someone help me everything is working except the register page? Any Help!
    Post the code

  3. #3
    Join Date
    Sep 2006
    Location
    United Kingdom
    Posts
    667
    Tokens
    0

    Default

    <?php
    include ("config.php");
    # include the config file

    if ($_POST['Submit']){


    $username = clean($_POST['username']);


    $password = clean($_POST['password']);

    $password_con = clean($_POST['password_con']);

    $email = clean($_POST['email']);

    $ip = clean($_SERVER['REMOTE_ADDR']);


    $signup = time();


    if (!$username | !$password | !$password_con | !$email){
    # if any of the strings form the form are empty
    echo 'You must fill in every field. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    if ($password != $password_con){

    echo 'Password fields did not match. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    $username_test = "SELECT * FROM `users` WHERE username = '$username'";
    $username_test = mysql_query($username_test);


    if (mysql_num_rows($username_test) == 1){

    echo 'Username is already being used. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    $md5pass = md5($password);


    $add = "INSERT INTO `users` VALUES ('', '$username', '$md5pass', '$email', '$ip', '$signup')";


    mysql_query($add);


    echo 'Success. You are now registered.<br />';
    echo 'Login using the following information:<br />';
    echo 'Username: '.$username.'<br />';
    echo 'Password: '.$password;

    }

    }

    }

    }
    else {

    ?>
    <form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
    Username:<br />
    <input type="text" name="username">
    <br />
    Password:<br />
    <input type="password" name="password">
    <br />
    Confirm Password:<br />
    <input type="password" name="password_con">
    <br />
    E-mail:<br />
    <input type="text" name="email">
    <br />
    <input type="submit" name="Submit" value="Register">
    </form>
    <?
    }
    ?>

  4. #4
    Join Date
    Nov 2004
    Location
    HabboWeb FM Offices
    Posts
    3,019
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Panther View Post
    <?php
    include ("config.php");
    # include the config file

    if ($_POST['Submit']){


    $username = clean($_POST['username']);


    $password = clean($_POST['password']);

    $password_con = clean($_POST['password_con']);

    $email = clean($_POST['email']);

    $ip = clean($_SERVER['REMOTE_ADDR']);


    $signup = time();


    if (!$username | !$password | !$password_con | !$email){
    # if any of the strings form the form are empty
    echo 'You must fill in every field. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    if ($password != $password_con){

    echo 'Password fields did not match. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    $username_test = "SELECT * FROM `users` WHERE username = '$username'";
    $username_test = mysql_query($username_test);


    if (mysql_num_rows($username_test) == 1){

    echo 'Username is already being used. <a href="'.$_SERVER['REQUEST_URI'].'">Back</a>.';
    }
    else {

    $md5pass = md5($password);


    $add = "INSERT INTO `users` VALUES ('', '$username', '$md5pass', '$email', '$ip', '$signup')";


    mysql_query($add);


    echo 'Success. You are now registered.<br />';
    echo 'Login using the following information:<br />';
    echo 'Username: '.$username.'<br />';
    echo 'Password: '.$password;

    }

    }

    }

    }
    else {

    ?>
    <form method="post" action="<?=$_SERVER['REQUEST_URI']?>">
    Username:<br />
    <input type="text" name="username">
    <br />
    Password:<br />
    <input type="password" name="password">
    <br />
    Confirm Password:<br />
    <input type="password" name="password_con">
    <br />
    E-mail:<br />
    <input type="text" name="email">
    <br />
    <input type="submit" name="Submit" value="Register">
    </form>
    <?
    }
    ?>
    Theres no line 12 on that page? Its just a blank space.

  5. #5
    Join Date
    Sep 2006
    Posts
    2,114
    Tokens
    0

    Latest Awards:

    Default

    Try pulling line 13 up 2 lines then re-upload and post the error
    Looking for a good desiner to design a social networking template.

    PM me.

Posting Permissions

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