| re: file locking
Sorry, the error occured on the first call to flock as indicated below.
"Bert" <bert_remove@meckcom.net> wrote in message
news:C417c.10157$_Q5.2458@fe07.usenetserver.com...[color=blue]
> I am new to php and am on chapter 2 PHP and MySQL by Welling and Thomson.
>
> When executing the code from the example to write the output data string:
>
> // open file for appending
> @ $fp = fopen("../../orders/orders.txt", "a");
>
> flock($fp, 2);
>
> if (!$fp) //line 56
> {
> echo "<p><strong> Your order could not be processed at this time. "
> ."Please try again later.</strong></p></body></html>";
> exit;
> }
>
> fwrite($fp, $outputstring);
> flock($fp, 3);
> fclose($fp);
>
> The processorder.php page opens and the screen output is ok. Then I get[/color]
the[color=blue]
> following message below the order echos:
>
> Warning: flock(): supplied argument is not a valid stream resource in
> c:\inetpub\wwwroot\phptest\PROCESSORDER.PHP on line 56
>
> Any advice of where I might find information on why I get this message[/color]
will[color=blue]
> be appreciated.
>
> Bert
>
>
>
>
>
>[/color] |