Writing to specific place in file?
| From: | John P. Donaldson | Date: | Fri, 01 Feb 2002 19:57:50 +0000 |
| Subject: | Writing to specific place in file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83174@lists.php.net to get a copy of this message | ||
I'm trying to modify a PHP form processor script that
writes to files. It writes to text files fine, but I
would like it to write to a specific place in a file
because I want the file to contain HTML tags. I can
start this file out by having the proper HTML tags at
the top of the file because it just appends to the
file. The problem is that the file won't have the
proper page closing tags. If I put those tags in the
file, the next time the script writes to the file, it
writes the variables below the closing HTML tags, so
now the page has content outside the HTML tags. I'd
like it to be able to write new text right below the
previous entry, not to the end of the file. I'm
thinking I need to tag each entry with an identifier,
have the script search for the last identifier, then
write the new entry below that. The only problem is,
I don't know how to do this. Is there another way to
do this?
Thanks,
John
__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com