Citation :
3. if you're using fseek() to write data to a file, remember to open the file in "r+" mode, example: $fp=fopen($filename,"r+" ); Don't open the file in mode "a" (for append), because it puts the file pointer at the end of the file and doesn't let you fseek earlier positions in the file (it didn't for me!). Also, don't open the file in mode "w" -- although this puts you at the beginning of the file -- because it wipes out all data in the file.
|