Closed Thread Icon

Topic awaiting preservation: how do I write to files(adding stuff, etc) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12222" title="Pages that link to Topic awaiting preservation: how do I write to files(adding stuff, etc) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: how do I write to files(adding stuff, etc) <span class="small">(Page 1 of 1)</span>\

 
sonic_tsunami
Bipolar (III) Inmate

From: some evil place, the evil little atoll
Insane since: Jan 2002

posted posted 05-15-2002 22:26

I know the chmod bit, but that's not what I'm asking,
I'm asking how you make a php file write to another file and add to it without corrupting it, or overwriting the current data.
trying to make something that can take care of adding new pages to my site easily by uploading a .txt file and adding the info to a file that takes care of the switch variable which is included to my main index file.
and have something that will edit my php files online, instead of having to keep opening ftp up.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

posted posted 05-15-2002 23:41

first do
http://www.php.net/manual/en/function.fopen.php
with a+ as mode
then do
http://www.php.net/manual/en/function.fputs.php
to write to the file.

finally do
http://www.php.net/manual/en/function.fclose.php
to close the file after writing.


« BackwardsOnwards »

Show Forum Drop Down Menu