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 successful. See examples in 
manual for details.

>         $success = fwrite( $fp, "$POST_['news']" );
                                  ^^^^^^^^^^^^^^^^

As has already been pointed out you don't need the double-quotes.

And it should be $_POST['news'].

>         fclose($fp);
>
>         if (!success)

This should be: if (!$success)

And please trim your post!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
We come to bury DOS, not to praise it.
(Paul Vojta, [EMAIL PROTECTED], paraphrasing a quote of Shakespeare)
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to