RE: [PHP] Problem writing to file, can't find the error
| From: | Mark Roedel | Date: | Thu, 01 Nov 2001 14:25:45 +0000 |
| Subject: | RE: [PHP] Problem writing to file, can't find the error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73156@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Jeff Lewis [mailto:jeff@hyrum.net]
> Sent: Thursday, November 01, 2001 7:21 AM
> To: php-general@lists.php.net
> Subject: [PHP] Problem writing to file, can't find the error
>
>
> I have this code in my program but I fail to find the error,
> does anyone see it after a quick glance?
>
> <?php
> if ($action == "save_filter") {
> $fh = fopen ("./filters.data.php", "r+b") or die ("couldnt
> open");
> $file = fread($fh, filesize("./filters.data.php"));
> $file = stripslashes($file);
> $array = unserialize($file);
> $array[] = array($filter, $name);
>
> $out = serialize($array);
> fwrite($fh, $out) or die;
>
> fclose($fh);
>
> }
> ?>
Sorry...my internal PHP parser is just a little rusty. Does this code
produce an error message? (If so, what does it say?) Or just not the
results you were expecting? (In which case, what results were you
expecting, and how did the actual results differ?)
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell