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)
{
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); //line 56
fclose($fp);
The processorder.ph p page opens and the screen output is ok. Then I get the
following message below the order echos:
Warning: flock(): supplied argument is not a valid stream resource in
c:\inetpub\wwwr oot\phptest\PRO CESSORDER.PHP on line 56
Any advice of where I might find information on why I get this message will
be appreciated.
Bert
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)
{
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); //line 56
fclose($fp);
The processorder.ph p page opens and the screen output is ok. Then I get the
following message below the order echos:
Warning: flock(): supplied argument is not a valid stream resource in
c:\inetpub\wwwr oot\phptest\PRO CESSORDER.PHP on line 56
Any advice of where I might find information on why I get this message will
be appreciated.
Bert
Comment