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 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1
    RedCrisps Guest

    Default [PHP] Help please.

    why won't this code work, so the password changes:
    PHP Code:
    <?php
    if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
    $check->login(); }
    else{
    session_start();
    include(
    "functions.php");
    $check = new checklogin;
    $check->login(); }
    echo(
    "
                      <b>Edit your password!</b><br/>
                     <br/>"
    );
    if(
    $_GET["act"] == "update")
    {
        
    $password clean($_POST["password"]);
        
    $password2 md5($password);
    $password2 sha1($password2);
        
    mysql_query("UPDATE `users` SET `password` = '$password2' WHERE `username` = '{$_SESSION["panel_username"]}'");
        echo(
    "Password Updated");
        exit;
    }
    else
    {
        
    $rand generateRandStr(13);
        echo(
    "Please set a new password:<br/><form action=\"?page=editpass&act=update\" method=\"POST\"><input type=\"text\" name=\"password\" value=\"$rand\" class=\"formbox\"> <b><-- Suggested</b><br/><br/><input type=\"submit\" name=\"submit\" value=\"Change Password\"><br/><br/>
        The suggested password was 
    $rand<br/>(So you can copy and paste)</form>");
    }
    ?>

  2. #2
    Join Date
    Aug 2005
    Location
    Tunbridge Wells, Kent
    Posts
    5,063
    Tokens
    1,624

    Latest Awards:

    Default

    And whats the error?
    Never argue with an idiot, he'll drag you down to his level, and beat you with experience.

    Quote Originally Posted by Recursion
    *oh trust me
    *I would NEVER go ATi
    And 15 mins later...
    Sapphire ATI Radeon HD 5850 1024MB GDDR5 PCI-Express Graphics Card £195.73 1 £195.73
    *ordered.

  3. #3
    RedCrisps Guest

    Default

    The password won't change

  4. #4
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Change..

    PHP Code:
    mysql_query("UPDATE `users` SET `password` = '$password2' WHERE `username` = '{$_SESSION["panel_username"]}'"); 
    To

    PHP Code:
    mysql_query("UPDATE `users` SET `password` = '$password2' WHERE `username` = '$_SESSION[EON_CNTPNL_USERNAME]'"); 
    That should work
    Coming and going...
    Highers are getting the better of me

  5. #5

    Default

    PHP Code:
    <?php
    if(isset($_SESSION["EON_CNTPNL_USERNAME"]))
    $check->login(); }
    else{
        
    session_start();
        include(
    "functions.php");
        
    $check = new checklogin;
        
    $check->login(); }
        echo(
    "
                      <b>Edit your password!</b><br/>
                     <br/>"
    );
        if(
    $_GET["act"] == "update")
        {
            
    $password clean($_POST["password"]);
            
    $password2 md5($password);
            
    $password2 sha1($password2);
            
    $username $_SESSION["panel_username"];
            
    mysql_query("UPDATE `users` SET `password` = '$password2' WHERE `username` = '$username'") or die(mysql_error());
            echo(
    "Password Updated");
            exit;
        }
        else
        {
            
    $rand generateRandStr(13);
            echo(
    "Please set a new password:<br/><form action=\"?page=editpass&act=update\" method=\"POST\"><input type=\"text\" name=\"password\" value=\"$rand\" class=\"formbox\"> <b><-- Suggested</b><br/><br/><input type=\"submit\" name=\"submit\" value=\"Change Password\"><br/><br/>
        The suggested password was 
    $rand<br/>(So you can copy and paste)</form>");
        }
    ?>

  6. #6
    RedCrisps Guest

    Default

    ty for the help i will try as soon as i get my laptop back

  7. #7
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Caleb, thats the same as the first version?

    panel_username isnt the session variable :rolleyes:
    Coming and going...
    Highers are getting the better of me

  8. #8

    Default

    Quote Originally Posted by MrCraig View Post
    Caleb, thats the same as the first version?

    panel_username isnt the session variable :rolleyes:
    How do you know that? Its included in his version, also it is not the same as the first version, the first version has no error handling.


    You don't know that is not the session, at the top it gives another session to check against, but that doesn't mean the same...

  9. #9
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Buy surely dan wouldnt set 2 username variables?
    Coming and going...
    Highers are getting the better of me

  10. #10
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Yeah I noticed the var $password 2 is being used twice, maybe that's a problem?

Page 1 of 3 123 LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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