4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Emptying a page with PHP
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Apr 28, 2002 4:35 pm (15 years, 5 months ago) Reply with QuoteBack to Top

Another question related to my script!

My script outputs headlines to a html file, and this is included in one of my pages, therefore giving me news headlines, however, is there a way I can make the file empty by adding a function to the script, but not deleting the file, because at the moment, I have to upload another blank copy of the article_summary.html file to empty it.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Sun Apr 28, 2002 5:02 pm (15 years, 5 months ago) Reply with QuoteBack to Top

Code:
$fp = fopen ("news.html", "w");
fwrite($fp, "");


if I read my book correctly this should write over existing data with nothing

no idea if it works though, give it a try Laughing
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Sun Apr 28, 2002 5:09 pm (15 years, 5 months ago) Reply with QuoteBack to Top

Yep, works brilliantly, thanks Smile
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.060098 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme