mscava Posted October 2, 2006 Share Posted October 2, 2006 first of all... i am newbie... well i'm trying to code a simple guestbook. i have ubuntu 6.06. the problem is that i just can't write into a file. i guess it has something to do with permissions. but my file book.txt has em -rw -rw -rw.here is my code:[code]<?php $path = "book.txt"; if ($action=='save'): @$file = fopen($path, "r"); @$content = fread($file, filesize($path)); @FClose($file); if (($message=="") or ($nick=="")): echo "<p>Nie su vyplnene pozadovane udaje!</p>"; else: $file = fopen($path, "w"); $str = "<div><h4>".$nick.", ".Date("d-m-Y, H:i:s")."</h4><p>".$message."</p></div>"; fputs($file, "$str"); fputs ($file, "$content"); FClose($file); @$file = fopen($path, "r"); @fpassThru($file); endif; else: @$file = fopen($path, "r"); @fpassThru($file); endif;?>[/code]anyone has any ideas what to do... or is it the code's fault? Quote Link to comment Share on other sites More sharing options...
alpine Posted October 2, 2006 Share Posted October 2, 2006 You can start by removing all your snails (@) and see what errors you get Quote Link to comment Share on other sites More sharing options...
mscava Posted October 2, 2006 Author Share Posted October 2, 2006 i got no errors Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.