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

Thread: How would I..

  1. #1
    Join Date
    Feb 2008
    Location
    London, UK
    Posts
    15,747
    Tokens
    25,786
    Habbo
    Mr-Trainor

    Latest Awards:

    Default How would I..

    ..add a page to a php script which will allow you to update a block of text (which will be echo'd onto the main site).

    -hopefully you know what I mean

    Not online very often

  2. #2
    Join Date
    Jun 2008
    Location
    England, On a beach somewhere
    Posts
    2,483
    Tokens
    691

    Latest Awards:

    Default

    TBH Luke if I was you I would download housekeeping guy and strip it to where you can post all you like.

  3. #3
    Join Date
    Feb 2007
    Location
    Essex, England
    Posts
    1,392
    Tokens
    0

    Latest Awards:

    Default

    Do you mean, you can edit the text of the page without actually altering the code? i.e. it takes it form a database or text file.


  4. #4
    Join Date
    Feb 2008
    Location
    London, UK
    Posts
    15,747
    Tokens
    25,786
    Habbo
    Mr-Trainor

    Latest Awards:

    Default

    Yea, just so you know..

    the reason I'm wanting to do this is to allow a values manager to update a recent changes text (I want it manual, not automatic) from the panel itself rather than giving them cpanel access.

    Not online very often

  5. #5
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    Sorry it's late, here's some bodge code

    PHP Code:

    <?php
    if($_POST['pw']=="passwordCaseSentitive"){
    $fp = @fopen('message.js''w');
    @
    fwrite($fp"document.write('".htmlentities($_POST['message'],ENT_QUOTES)."');");
    @
    fclose($fp);
    die(
    "<b>Message changed :)</b>");
    }
    die(
    "<h1>Change message</h1><form method='post'><table><tr><td><b>Password:</b></td><td><input type='password' name='pw' /></td></tr><tr><td><b>Message:</b></td><td><input type='text' name='message' /></td></tr><tr><td></td><td><input type='submit' value='Set message' /></td></tr></table></form>");
    ?>
    Save that as setmessage.php. It will create a file called message.js containing some JS code to show the message.

    Use this code to display the message:
    Code:
    <script src='message.js'></script>
    To change the message, just open setmessage.php in a browser, type in password + message and it will change.

    I haven't actually tested the code, let me know if you have any problems
    Last edited by Apolva; 05-05-2010 at 09:17 PM.

  6. #6
    Join Date
    Feb 2008
    Location
    London, UK
    Posts
    15,747
    Tokens
    25,786
    Habbo
    Mr-Trainor

    Latest Awards:

    Default

    Thanks, I'll try that out later/soon and let you know how it goes

    Not online very often

Posting Permissions

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