www.webdeveloper.com
Results 1 to 4 of 4

Thread: Going Backwards

  1. #1
    Join Date
    Jan 2004
    Location
    UK
    Posts
    13

    Going Backwards

    I'm creating my Own Tagboard and I want the information stored to Displayed with the newest on top instead of just recording the results going downways.

    My current Code is:

    <?php
    $file= 'tag.txt';
    $handle = fopen($file,"r");
    $string = fread($handle,filesize($file));
    fclose($handle);
    $handle = fopen($file,"w");
    $string = $string . "<A href=$url target=_blank>$name</a>: $message<br>";
    fwrite($handle,$string);
    fclose($handle);
    ?>

    <?php
    include("view.php");
    ?>


    Can I simply Modify this to get it to Store Stuff at the top of the file not the bottom?

  2. #2
    Join Date
    Aug 2003
    Posts
    1,576
    yes.
    $string = "<A href=$url target=_blank>$name</a>: $message<br>" . $string;
    your original code was concatonating $string before the text to add rather than after.

  3. #3
    Join Date
    Jan 2004
    Location
    UK
    Posts
    13
    Oooh Simple.
    Thanks.
    You always seem to help me =)

  4. #4
    Join Date
    Aug 2003
    Posts
    1,576
    No problem, glad to help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles