Real Estate Forums

Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here.

Reply
 
Thread Tools Display Modes
Old 06-10-2007, 11:02 PM
RESynergy RESynergy is offline
Real Estate WebMaster
 
Join Date: Nov 2006
Posts: 109
RESynergy is on a distinguished road
Default Using PHP to write a file

This is pretty much my first time using fwrite() in php. Basically I'm writing a list from an array to the page but it overwrites the material over the old. I need it to add the new material at the end of the previous material so that both the old and the new are both on the page.

From the manuals and tutorials etc it looks like the only way to do this is to fread() the file first, add the new material from the array to the original, and save it. Is that what I need to do? Is there a better way? Seems awfully inefficient. Thanks

Last edited by RESynergy; 06-10-2007 at 11:04 PM.
Reply With Quote
Old 06-10-2007, 11:31 PM
RESynergy RESynergy is offline
Real Estate WebMaster
 
Join Date: Nov 2006
Posts: 109
RESynergy is on a distinguished road
Default Re: Using PHP to write a file

Hey, I found it. "Quite illogical, Captain" Mr Spock said.
You have to tell it where to start writing not in the writing function but in the fopen() function. hmmm
Reply With Quote
Old 06-11-2007, 11:27 PM
REW Fergus's Avatar
REW Fergus REW Fergus is offline
Real Estate Webmasters Staff
 
Join Date: Aug 2006
Location: Nanaimo, BC
Posts: 588
REW Fergus is on a distinguished road
Default Re: Using PHP to write a file

Quote:
Originally Posted by RESynergy View Post
Hey, I found it. "Quite illogical, Captain" Mr Spock said.
You have to tell it where to start writing not in the writing function but in the fopen() function. hmmm
Right. Sounds like you want to open the file for appending rather than writing. Slightly confusing since both are really write operations, but appending is a special case.
__________________
Fergus Gibson
realestatewebmasters.com
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



For our members

Main Sections

IDX Coverage Areas

Spiders Welcome

All times are GMT -7. The time now is 06:26 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.