PHP 4.3.4.4

From: Bert (bert_remove_at_meckcom.net)
Date: 03/25/04


Date: Thu, 25 Mar 2004 09:12:25 -0500

I am new to all this testing server terminolgy. For the last 6 days I have
read everything I can find on installing php/mysql, IIS as a testing server.

IIS, MySQL, PHP installed and apparently working but since I have never had
any experience with any of them I can't be sure.

WinXP Pro
IIS
PHP 4.3.4.4

I am on chapter 2 of Welling and Thompson PHP and MySQL book which is for an
earlier version of php.

Once I discovered this I was able to change some of the ini settings to get
it working.

There are two pages I am working with entered as called for in the book:
orderform.htm and processorder.php

The submit buttom calls the processorder.php and executes the php
statements, sets the variables, echo to the screen preforms calucations
etc., until I get to the fopen() function and I get the message below.

Warning: fopen(http://localhost/phptest/orderfile/orders.txt): failed to
open stream: HTTP wrapper does not support writeable connections. in
c:\inetpub\wwwroot\phptest\processorder.php on line 56

Warning: flock(): supplied argument is not a valid stream resource in
c:\inetpub\wwwroot\phptest\processorder.php on line 57

Your order could not be processed at this time. Please try again later.

The relevant code section:

$outputstring = $date."\t".$tyreqty." tyres \t".$oilqty." oil\t"
                  .$sparkqty." spark plugs\t\$".$total
                  ."\t". $address."\n";

  // open file for appending
$fp = fopen("http://localhost/phptest/orderfile/orders.txt", "a+");

flock($fp, 2);
  {
    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);

  echo "<p>Order written.</p>";

?>

In the IIS console I selected the phptest/orderfile folder and checked read
and write.

I have read the help on stream and it makes no sense to me at all.

I am totally frustrated at this point. I have been going around in circles
and am no closer to getting the problem soved than I was 6 days ago.

Any advice, suggestions, links etc will be greatly appreciated.

Bert