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 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Sep 2005
    Posts
    1,604
    Tokens
    0

    Latest Awards:

    Default

    Try this

    PHP Code:
    <?php

    // This gets the information from the form
    $name $_POST['name'];
    $message $_POST['message'];

    // This takes the smiley code in the message and turns it into a smiley
    $code = array(
        
    '/:\)/',
        
    '/:P/',
        
    '/:D/'
    );

    $image = array(
        
    '<img src="smileys/smile.gif">',
        
    '<img src="smileys/razz.gif">',
        
    '<img src="smileys/biggrin.gif">'
    );
    $formatted preg_replace($code$image$message);

    if(empty(
    $name) OR empty($message))
    {
    echo 
    "Please fill it out the name,website or message field.";
    }
    else
    {
    // Set up how it's going to be displayed.
    $tag = ("<font size=\"2\" face=\"Arial\">
    <a href=\"htmlspecialchars(
    $website);\" target=\"_blank\">htmlspecialchars($name)</a>: htmlspecialchars($formatted);
    </font><br>"
    ); 

    // Gather the data currently in the file
    $read fopen("content.txt""r");
    $contents fread($readfilesize('content.txt'));
    fclose($read);

    // Open the file and write the tag to it
    $write fopen("content.txt""w");
    fwrite($write"$tag $contents");
    fclose($write);
    }

    // Refresh!
    print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">";

    ?>
    Btw have you CHMODED content.txt to 777?

  2. #12
    Join Date
    Jun 2006
    Posts
    125
    Tokens
    0

    Default

    PHP Code:
    <?php

    // This gets the information from the form
    $name $_POST['name'];
    $website $_POST['website'];
    $message $_POST['message'];

    // This takes the smiley code in the message and turns it into a smiley
    $code = array(
        
    '/:\)/',
        
    '/:P/',
        
    '/:D/'
    );

    $image = array(
        
    '<img src="smileys/smile.gif">',
        
    '<img src="smileys/razz.gif">',
        
    '<img src="smileys/biggrin.gif">'
    );
    $formatted preg_replace($code$image$message);

    if(empty(
    $name) OR empty($website) OR empty($message))
    {
    echo 
    "Please fill it out the name,website or message field.";
    }
    else
    {
    // Set up how it's going to be displayed.
    $tag = ("<font size=\"2\" face=\"Arial\">
    <a href=\"
    $website\" target=\"_blank\">$name</a>: $formatted;
    </font><br>"
    ); 

    // Gather the data currently in the file
    $read fopen("content.txt""r");
    $contents fread($readfilesize('content.txt'));
    fclose($read);

    // Open the file and write the tag to it
    $write fopen("content.txt""w");
    fwrite($write"$tag $contents");
    fclose($write);
    }

    // Refresh!
    print "<meta http-equiv=\"refresh\" content=\"0;shoutbox.php\">";

    ?>
    All sites sold at the moment.

  3. #13
    Join Date
    Sep 2005
    Posts
    1,604
    Tokens
    0

    Latest Awards:

    Default

    *removed*
    Last edited by ClubTime; 08-08-2006 at 10:07 PM.

Page 2 of 2 FirstFirst 12

Posting Permissions

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