HabboxWiki needs you!
Are you a Habbo buff? Or maybe a rare trader with a bunch of LTDs? Get involved with HabboxWiki to share your knowledge!
Join our team!
Whether you're raving for rares, excited for events or happy helping, there's something for you! Click here to apply
Need a helping hand?
Check out our guides for all things to help you make friends, make rooms, and make money!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Oct 2006
    Location
    Doncaster, UK
    Posts
    1,458
    Tokens
    0

    Latest Awards:

    Default Need PHP Help Part II

    Ok, again my site user system is playing up:-

    http://habboit.info
    or
    http://xvisor.connect-hosting.com

    If you try and register, fill out all the forms etc it says "some fields were left blank" or something like that.

    Here's the register file:-

    PHP Code:
    <html>
    <head>
    <title>Home</title>
    <style type="text/css">
    a {
    font-size: 10px;
    color: #000000;
    }
    a:link {
    text-decoration: none;
    color: #000000;
    }
    a:visited {
    text-decoration: none;
    color: #000000;
    }
    a:hover {
    text-decoration: underline;
    color: #000000;
    }
    a:active {
    text-decoration: none;
    color: #000000;
    }
    body,td,th,p {
    font-family: Verdana;
    font-size: 10px;
    color: #000000;
    }
    .5 { color: #ff0000; font-weight: bold; }
    .4 { color: #ff6600; font-weight: bold; }
    .3 { color: #006600; font-weight: bold; }
    .2 { color: #000099; font-weight: bold; }
    .1 { color: #000000; }
    input {
        font-family: Tahoma, Arial;
        font-size: 8pt;
        font-weight: bold;
        color: #000000;
        background-color: #FFFFFF;
        border: 1px solid #000000;
    }


    </style>
    </head>
    <body bgcolor="#EFEFEF">
    Before you can use our User System you must register below.
    </body>
    </html>
    <?php 
    ob_start
    (); 
    // allows you to use cookies 
    include("config.php"); 
    //gets the config page 
    if ($_POST[register]) { 
    // the above line checks to see if the html form has been submitted 
    $username $_POST[username]; 
    $password $_POST[pass]; 
    $cpassword $_POST[cpass]; 
    $email $_POST[emai1]; 
    //the above lines set variables with the user submitted information 
    if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL|$checkbox==FALSE) { 
    //checks to make sure no fields were left blank 
    echo "A field was left blank."
    }else{ 
    //none were left blank!  We continue... 
    if($password != $cpassword) { 
    // the passwords are not the same!   
    echo "Passwords do not match"
    }else{ 
    // the passwords are the same!  we continue... 
    $password md5($password); 
    // encrypts the 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) { 
    // oops...someone has already registered with that username or email! 
    echo "The username or email is already in use"
    }else{ 
    // noone is using that email or username!  We continue... 
    $username htmlspecialchars($username); 
    $password htmlspecialchars($password); 
    $email htmlspecialchars($email); 
    // the above lines make it so that there is no html in the user submitted information. 
    //Everything seems good, lets insert. 
    $query mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')"); 
    // inserts the information into the database. 
    echo "You have successfully registered!"




    else 

    // the form has not been submitted...so now we display it. 
    echo (
    <form method=\"POST\"> 
    <table border=\"0\" width=\"100%\">
      <tr>
        <td width=\"50%\"> 
    Username:&nbsp;</td>
        <td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"25\" name=\"username\"></td>
      </tr>
      <tr>
        <td width=\"50%\"> 
    Password:&nbsp;</td>
        <td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"pass\"></td>
      </tr>
      <tr>
        <td width=\"50%\"> 
    Confirm Password:</td>
        <td width=\"50%\"> <input type=\"password\" size=\"20\" maxlength=\"25\" name=\"cpass\"></td>
      </tr>
      <tr>
        <td width=\"50%\"> 
    Email:&nbsp;</td>
        <td width=\"50%\"> <input type=\"text\" size=\"20\" maxlength=\"50\" name=\"emai1\"></td>
      </tr>
    </table>
    <p>
    <input type='checkbox' name='checkbox' /> <a href='rules.php'>I have read, and agree with the rules</a><br /> 
    <input name=\"register\" type=\"submit\" value=\"Register\"> 
    </p>
    </form> 

    "
    ); 

    ?>
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have images in your signature which are over the size limit for your usergroup.

  2. #2
    Join Date
    May 2006
    Location
    Wakefield, West Yorkshire
    Posts
    1,118
    Tokens
    0

    Latest Awards:

    Default

    remove the "agreed to terms and conditions" thing I think that is causing the prob

  3. #3
    Join Date
    Oct 2006
    Location
    Doncaster, UK
    Posts
    1,458
    Tokens
    0

    Latest Awards:

    Default

    I'm no good at PHP and I will probably **** the code up completely.

    No, it didn't work - thanks for trying.
    Last edited by adm; 16-10-2006 at 06:23 PM.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have images in your signature which are over the size limit for your usergroup.

  4. #4
    Join Date
    Aug 2005
    Posts
    856
    Tokens
    0

    Default

    Ah, My usersystem. If you wish to contact me on MSN Ill send you the new file, it has no errors.

  5. #5
    Join Date
    Oct 2006
    Location
    Doncaster, UK
    Posts
    1,458
    Tokens
    0

    Latest Awards:

    Default

    I contacted you before and you said...
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have images in your signature which are over the size limit for your usergroup.

  6. #6
    Join Date
    Jul 2005
    Posts
    1,653
    Tokens
    50

    Latest Awards:

    Default

    xRoyal, how is that yours?

    It's clear to see that's techtuts code lol..

    EDIT: The error is because you haven't used POST to see if the user has clicked or hasn't clicked the box thing for the rules.
    Last edited by RYANNNNN; 16-10-2006 at 08:50 PM.

  7. #7
    Join Date
    Oct 2006
    Location
    Doncaster, UK
    Posts
    1,458
    Tokens
    0

    Latest Awards:

    Default

    This system is full of errors.

    Now, when I register, and try to log in it says incorrect username and/or password...
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have images in your signature which are over the size limit for your usergroup.

  8. #8
    Join Date
    Oct 2006
    Posts
    263
    Tokens
    0

    Default

    Just ask for a refund.
    VB Programmer looking for work

  9. #9
    Join Date
    Oct 2006
    Location
    Doncaster, UK
    Posts
    1,458
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by James.Easy View Post
    Just ask for a refund.
    That was a pointless posts - he doesn't believe in refunds.
    REMOVED

    Edited by jesus (Forum Super Moderator): Please do not have images in your signature which are over the size limit for your usergroup.

  10. #10
    Join Date
    Oct 2006
    Posts
    300
    Tokens
    0

    Default

    The person who sold you that script is a idiot.

    He should of checked that there was no errors before selling it to you.

    He should give you support and if its an error down to him doing the coding wrong he should repair is a.s.a.p.

    Plus you can cleary see that it is a rip from techtuts. The only difference is, is that change the look of it and added some very simple CSS.

    Techtuts [http://www.techtuts.com/forums/index.php?showtopic=48]
    PHP Code:
    <?php
    ob_start
    ();
    // allows you to use cookies
    include("config.php");
    //gets the config page
    if ($_POST[register]) {
    // the above line checks to see if the html form has been submitted
    $username $_POST[username];
    $password $_POST[pass];
    $cpassword $_POST[cpass];
    $email $_POST[emai1];
    //the above lines set variables with the user submitted information
    if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) {
    //checks to make sure no fields were left blank
    echo "A field was left blank.";
    }else{
    //none were left blank!  We continue...
    if($password != $cpassword) {
    // the passwords are not the same!  
    echo "Passwords do not match";
    }else{
    // the passwords are the same!  we continue...
    $password md5($password);
    // encrypts the 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) {
    // oops...someone has already registered with that username or email!
    echo "The username or email is already in use";
    }else{
    // noone is using that email or username!  We continue...
    $username htmlspecialchars($username);
    $password htmlspecialchars($password);
    $email htmlspecialchars($email);
    // the above lines make it so that there is no html in the user submitted information.
    //Everything seems good, lets insert.
    $query mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')");
    // inserts the information into the database.
    echo "You have successfully registered!";
    }
    }
    }
    }
    else
    {
    // the form has not been submitted...so now we display it.
    echo ("
    Idiot That Sold It You
    PHP Code:
    <?php 
    ob_start
    (); 
    // allows you to use cookies 
    include("config.php"); 
    //gets the config page 
    if ($_POST[register]) { 
    // the above line checks to see if the html form has been submitted 
    $username $_POST[username]; 
    $password $_POST[pass]; 
    $cpassword $_POST[cpass]; 
    $email $_POST[emai1]; 
    //the above lines set variables with the user submitted information 
    if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL|$checkbox==FALSE) { 
    //checks to make sure no fields were left blank 
    echo "A field was left blank."
    }else{ 
    //none were left blank!  We continue... 
    if($password != $cpassword) { 
    // the passwords are not the same!   
    echo "Passwords do not match"
    }else{ 
    // the passwords are the same!  we continue... 
    $password md5($password); 
    // encrypts the 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) { 
    // oops...someone has already registered with that username or email! 
    echo "The username or email is already in use"
    }else{ 
    // noone is using that email or username!  We continue... 
    $username htmlspecialchars($username); 
    $password htmlspecialchars($password); 
    $email htmlspecialchars($email); 
    // the above lines make it so that there is no html in the user submitted information. 
    //Everything seems good, lets insert. 
    $query mysql_query("INSERT INTO users (username, password, email) VALUES('$username','$password','$email')"); 
    // inserts the information into the database. 
    echo "You have successfully registered!"




    else 

    // the form has not been submitted...so now we display it. 
    echo ("
    Selling other people's work. Shame on you plus it proves that you must be crap at PHP to copy Techtuts member system :|
    Regards
    -
    Daniel Adams Watt

    Dont Judge People By The Join Date And Post Count

    Freelance Web Designer

Page 1 of 2 12 LastLast

Posting Permissions

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