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!


Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 43

Thread: Login Page

  1. #21
    Join Date
    Aug 2008
    Posts
    36
    Tokens
    0

    Default

    Quote Originally Posted by BOX! View Post
    I get this when I try to use headers:
    Warning: Cannot modify header information - headers already sent by (output started at /home/x/public_html/test/login.php:11) in /home/x/public_html/test/login.php on line 17
    Try adding this at the top:

    PHP Code:
    ob_start(); 

  2. #22
    Join Date
    Jul 2008
    Posts
    535
    Tokens
    75

    Default

    Thanks, that worked.

  3. #23
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    asuming your MD5ing your passwords..

    EDIT: Just saw you had a fix.

    PHP Code:
    <?php

    // if logged in goto homepage, if not continue
    if($grab_login == 1) {
        
    header"Location: index.php" );
    } else {
        if(
    $_GET ['do'] == "login") {
            
            
    // make sure you clean these..
            
    $username $_POST ['username'];
            
    $password md5$_POST ['password'] );
            
            
    $data = @mysql_query"SELECT * FROM `users` WHERE `username` = '$username' AND `password`='$password'" );
            
    $count = @mysql_num_rows$data );
            
            
    // checks if the username and password the user entered matches the ones in the database
            
    if($count != 0) {
                
    $_SESSION ['username'] = $username;
                
    $_SESSION ['logged_in'] = 1;
                
    header"Location: index.php" );
            } else {
                echo 
    "your login credentials were incorrect.";
            }
        }
    }
    ?>
    <form action="?do=login" method="post"><input type="text"
        name="username" /> <input type="password" name="password" /> <input
        type="submit" value="login" />
    Last edited by Dentafrice; 16-11-2008 at 11:58 PM.

  4. #24
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Good move using POST instead of GET, esp for a login script. Stuff like that can potentially be picked up on the statistics software on your server, potentially allowing you to see passwords in plaintext.

  5. #25
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Beau View Post
    Good move using POST instead of GET, esp for a login script. Stuff like that can potentially be picked up on the statistics software on your server, potentially allowing you to see passwords in plaintext.
    I don't know any idiot who would use GET for something that processes sensitive data..

  6. #26
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by Dentafrice View Post
    I don't know any idiot who would use GET for something that processes sensitive data..
    Well, this script didn't specify a method up until the last revision. When there's no method, it results to GET...

  7. #27
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    You don't think I know that? i don't need to be told what it reverts to when no method is specified.

    I'm just saying, it's clear this user doesn't know much about this, or how it all works in general.

  8. #28
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by Dentafrice View Post
    You don't think I know that? i don't need to be told what it reverts to when no method is specified.

    I'm just saying, it's clear this user doesn't know much about this, or how it all works in general.
    Hence I commended him on adding POST, explaining the reasons why GET is bad for this sort of form.

    Stop jumping down my throat.

  9. #29
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    7,554
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Beau View Post
    Stop jumping down my throat.
    Dentafrice doesn't like people correcting him.. he can't handle it

  10. #30
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Quote Originally Posted by Beau View Post
    Hence I commended him on adding POST, explaining the reasons why GET is bad for this sort of form.

    Stop jumping down my throat.
    I'm not jumping down your throat, but I just think most people are smarter then that, I've never in my 4-5 years on this forum seen anyone use GET for a login submission. Ever.

    Thanks for telling us all some common sense!

    Quote Originally Posted by Blinger View Post
    Dentafrice doesn't like people correcting him.. he can't handle it
    No one corrected me, are you stupid? If you'd read the posts you'd see no-one corrected me, I just saw a stupid post Beau posted, and criticized him for it.

    Shows how much some of you pay attention :rolleyes:.

Page 3 of 5 FirstFirst 12345 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
  •