note 22027 deleted from function.fwrite by dams

From: Date: Tue, 04 Jun 2002 12:02:22 +0000
Subject: note 22027 deleted from function.fwrite by dams
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-31427@lists.php.net to get a copy of this message
Can someone please help me with this? <form action="<? $PHP_SELF; ?>" method="post" autocomplete="off"> <table width="640" cellspacing="0" cellpadding="0" border="0" align="center"> <tr><td>Your name</td><td><input type="text" name="name" size="20" maxlength="20"></td></tr> <tr><td>Your message</td><td><textarea name="entry" rows="15" cols="50" wrap="virtual"></textarea></td></tr> <tr><td colspan="2" align="center"><input type="submit" value="Post Entry"></td></tr> </table> </form> <? $data_file = "data.txt"; $entry = $_POST["name"].$_POST["entry"]; $fp = fopen($data_file,"a") or die ("Error opening"); fwrite($fp,$entry) or die ("Error writing"); fclose($fp); include($data_file); ?> I get error from fwirte (not syntax error), it just die and tell me Error writing. This happens only when data.txt is empty, could someone tell me how to fix this? Thank you.

« previous php.notes (#31427) next »