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 2 of 2
  1. #1
    Join Date
    Dec 2006
    Location
    Kent, UK
    Posts
    627
    Tokens
    138
    Habbo
    Romanity

    Latest Awards:

    Default PHP MySql Errors

    PHP Code:
    <?
    ob_start
    ();
    include(
    "config.php");
    ?>
    <html>
    <head>
    <title>Home</title>
    <link href="housekeeping.css" rel="stylesheet" type="text/css">
    </head>
    <body bgcolor="#ffffff" class='content'>
    <b>Featured Content</b><br />Use this page to update the content in the Large boxes of the main content page.<br><br>
    <?
    if(isset($logged[username]) && $v[99] == on){
    switch(
    $_GET[act]){
    default:

    $query mysql_query("SELECT * FROM `settings` WHERE `id` = '17'");    
    $result mysql_fetch_array($query);      
    $shoutout stripslashes($result["desc"]);    

    $query3 mysql_query("SELECT * FROM `settings` WHERE `id` = '14'");    
    $result3 mysql_fetch_array($query3);      
    $shoutout3 stripslashes($result3["desc"]);    

    $query2 mysql_query("SELECT * FROM `settings` WHERE `id` = '15'");    
    $result2 mysql_fetch_array($query2);      
    $shoutout2 stripslashes($result2["desc"]);    

    $announce mysql_query("SELECT * FROM `settings` WHERE `id` = '21'");    
    $announce2 mysql_fetch_array($announce);      
    $announcee stripslashes($announce2["desc"]);    

    $show_poll mysql_query("SELECT * FROM `settings` WHERE `id` = '22'");    
    $show_poll mysql_fetch_array($show_poll);   

    echo(
    "<form method='post' action='?hk_mode=4&page_view=home_content&act=process'>");

    echo 
    "Show Latest Poll?<br>
    Yes <input type='radio' name='show_poll' value='1'"
    ; if($show_poll[status] == '1'){ echo "checked"; } echo "> No <input type='radio' name='show_poll' value='0'"; if($show_poll[status] == '0'){ echo "checked"; } echo "><br>";

    if(
    $v[92] == 'on'){
    echo 
    "<br>Official Announcement:<br>
    <i>Check to turn <b>ON</b></i> <input type='checkbox' name='announce_status'"
    ;
    if(
    $announce2[status] == 'on'){ echo "checked"; }
    echo 
    "><br><textarea name='announce' rows='10'>$announcee</textarea><br><br>";
    }

    echo(
    "About OurHabbo: <br><textarea name='box' rows='10'>$shoutout</textarea><br><br>
    OurHabbo Catalogue: <br><textarea name='boxx' rows='10'>
    $shoutout2</textarea><br><br>
    Features:<br><textarea name='boxxx' rows='10'>
    $shoutout3</textarea><br><br>
    <input type='submit' name='send' value='Submit'>  
    </form>"
    );
    break;

    case 
    'process':
    $user $logged[username];
    $box addslashes($_POST[box]);
    $boxx addslashes($_POST[boxx]);
    $boxxx addslashes($_POST[boxxx]);
    $query mysql_query("UPDATE `settings` SET `desc` = '$box', `user` = '$user' WHERE `id` = '17'") or die(mysql_error()); //BROKEN
    $query2 mysql_query("UPDATE `settings` SET `desc` = '$boxx', `user` = '$user' WHERE `id` = '15'") or die(mysql_error()); //BROKEN
    $query3 mysql_query("UPDATE `settings` SET `desc` = '$boxxx', `user` = '$user' WHERE `id` = '14'") or die(mysql_error()); //BROKEN
    $query4 mysql_query("UPDATE `settings` SET `status` = '$_POST[show_poll]', `user` = '$user' WHERE `id` = '22'") or die(mysql_error()); //BROKEN

    if($query){ echo "About OurHabbo Updated<br>"; }
    if(
    $query2){ echo "OurHabbo Catalogue Updated<br>"; }
    if(
    $query3){ echo "Features Updated<br>"; }
    if(
    $query4){ echo "Show Latest Poll Updated<br>"; }

    if(
    $v[92] == 'on'){
    $announce addslashes($_POST[announce]);
    $query4 mysql_query("UPDATE `settings` SET `desc` = '$announce', `status` = '$_POST[announce_status]', `user` = '$user' WHERE `id` = '21'") or die(mysql_error()); //BROKEN
    if($query4){ echo "Official Announcement Updated<br>"; }
    mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Updated Official Announcement', '$logged[username]', '$date')");
    }


    mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Updated Content on Homepage', '$logged[username]', '$date')");

    break;
    }
    }else{
    echo(
    "You must be an Adminisitrator to view this!");
    }
    ?> 
    </body>
    </html>
    Right, so the problem is.. it works fine, and i see no errors... but when it updates, every single query thats meant to update something, sets `desc` as a ' ' (no content) rather than the content in the textareas....

    Any errors Im missing?

    Ive marked up the broken queries

    EDIT: Should mention, the queries all run and theres no error returned, so problem = mystery
    Last edited by Romanity; 21-07-2008 at 12:04 PM.
    Sangreal / Romanity ~ Habbo UK & USA
    [OurHabbo.Net Owner]
    Lewis. (Formerly xRoyal15)

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

    Latest Awards:

    Default

    change them to

    PHP Code:
    $_POST["box"]
    $_POST["boxx"]
    $_POST["boxxx"

Posting Permissions

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