> -----Original Message----- > From: Jeff Lewis [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 01, 2001 7:21 AM > To: [EMAIL PROTECTED] > 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]