guestbook in php: writting problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
orangeapple
Forum Commoner
Posts: 70
Joined: Tue Jan 06, 2004 1:24 pm
Location: Geneva / Switzerland

guestbook in php: writting problems

Post by orangeapple »

Hi there,

I did a guestbook in php replacing a marker in the target guestbook.html file with the marker+new entry. It tworks perfectly locally. On the server, I have no message error, and the command fwrite returns the correct number of bytes written, although it leaves the file guestbook.html unchanged (writting actually nothing in it).

This is the part of the code used to write the new entry in the guestbook.html file:

$file = preg_replace($MOTIF, $add, $file);
$fp = fopen("$GUEST_FILE", "wb"); //or error("Can not write \$GUEST_FILE");
flock($fp, 1);
$test=fputs($fp, $file);
//print("$test");
flock($fp, 3);
fclose($fp);

Thanks in advance for the answer.
User avatar
orangeapple
Forum Commoner
Posts: 70
Joined: Tue Jan 06, 2004 1:24 pm
Location: Geneva / Switzerland

Post by orangeapple »

anyone ??? :?
Post Reply