[PHP] fwrite() question

2003-07-01 Thread Adam Williams
Hello, I have a block of code: ?php if ($_POST['news']) { $fp = fopen( news.txt, w); $success = fwrite( $fp, $POST_['news'] ); fclose($fp); if (!success) { echo punable to write to news.txt/p; exit; } Header(Location:

Re: [PHP] fwrite() question

2003-07-01 Thread Adrian
you should use $_POST['news'] instead of $POST_['news']. ans you also should'nt put around variables ;) Hello, I have a block of code: ?php if ($_POST['news']) { $fp = fopen( news.txt, w); $success = fwrite( $fp, $POST_['news'] );

Re: [PHP] fwrite() question

2003-07-01 Thread Adam Williams
Hi, when I do that, nothing is written to news.txt, and I'm not sure why. This is the entire script: ?php if ($_POST['news']) { $fp = fopen( news.txt, w); $success = fwrite( $fp, $POST_['news'] ); fclose($fp); if (!success) { echo punable to

Re: [PHP] fwrite() question

2003-07-01 Thread Jason Wong
On Tuesday 01 July 2003 22:12, Adam Williams wrote: when I do that, nothing is written to news.txt, and I'm not sure why. Well find out why! This is the entire script: ?php if ($_POST['news']) { $fp = fopen( news.txt, w); Add some error-checking to see whether fopen() was