Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I make a fwrite function place a message before the existing text?.....

    ......How can i have a block of text sent from a form be placed at the top of a text file?

    currently using a+, r+ replaces all existing, i need the existing text to remain, and the new text to appear at the top.

  • #2
    Registered User
    Join Date
    Feb 2003
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey

    You need to read the existing data. Store it in a variable. For eg $existing.

    then when you write, write $new$existing...

    So that the new is at the top of the file. I don't think there is a function for entering new data without deleting the old. But I think this method serves the purpose.

    Jesh


  •  

    Posting Permissions

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