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 6 of 6
  1. #1
    Join Date
    Nov 2008
    Location
    UK
    Posts
    173
    Tokens
    0
    Habbo
    coolchris322

    Latest Awards:

    Default [help] PHP Errors

    Ok, first error. this
    PHP Code:
    session_start();
    $username $_SESSION['myusername'];
    $query mysql_query("SELECT * FROM `community` WHERE username='$username'");
    $row mysql_fetch_array($query);
    ... 
    blah blah blah ...
                if(
    $row['ban'] = "1")
                    echo 
    '<td><a href=\'?change=appealban\' target=\'_self\'>Appeal Ban</a></td>'
    now, it echo's appeal ban even when ban = 0.

    Second issue,
    PHP Code:
    session_start();
    $loggeduser $_SESSION['myusername'];
    include 
    'config.php';
    $username $_GET['name'];
    $query mysql_query("SELECT * FROM `community` WHERE username='$username'");
    $row mysql_fetch_array($query);
    $query2 mysql_query("SELECT * FROM `community` WHERE username='$loggeduser'");
    $row2 mysql_fetch_array($query2);
    ... 
    blah blah blah ...
    if (
    $loggeduser $row['habboname']) {
        echo 
    "<a href='editprofile.php'>Edit Your Profile</a>";
    }
    if (
    $row2['rank'] = "Administrator") {
        echo 
    "<a href='edituser.php?name=".urlencode(htmlspecialchars($row['username'], ENT_QUOTES))."'>Edit User</a>";

    This 1. shows edit profile when you logout and clear your cache, but only on your profile o.O
    2. echo's Edit User even when your logged out, logged in with non-admin etc.

    Any help please.

  2. #2
    Join Date
    Nov 2008
    Location
    UK
    Posts
    173
    Tokens
    0
    Habbo
    coolchris322

    Latest Awards:

    Default

    Anyone here to help
    Last edited by coolchris322; 11-10-2010 at 05:28 PM.

  3. #3
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    In some cases, u need to use "==" instead of "=" that will be your problems I suspend

    Lew.
    Last edited by LMS16; 11-10-2010 at 08:33 PM.
    Im not here to be loved, I love to be hated :-}


  4. #4
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    You use "=" in order to set (assign) a value to variables, "==" in order to compare both sides.

    http://www.php.net/manual/en/languag...comparison.php

    As Lewiie says, seems to be the only problem.

  5. #5
    Join Date
    Aug 2009
    Posts
    78
    Tokens
    100

    Latest Awards:

    Default

    Just to reiterate the above, one = sign assigns a variable, two = signs compares a variable.

    BTW, if you are using single quotes you don't need to escape your HTML:
    PHP Code:
    session_start();
    $username $_SESSION['myusername'];
    $query mysql_query("SELECT * FROM `community` WHERE username='$username'");
    $row mysql_fetch_array($query);
    ... 
    blah blah blah ...
                if(
    $row['ban'] = "1")
                    echo 
    '<td><a href="?change=appealban" target="_self">Appeal Ban</a></td>'

  6. #6
    Join Date
    Nov 2008
    Location
    UK
    Posts
    173
    Tokens
    0
    Habbo
    coolchris322

    Latest Awards:

    Default

    I know == does that, but that broke too .

    anyhow, i did a mysql dump file and checked against values and counts to fix it :/

Posting Permissions

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