Why i can't write to remote file ?

From: Date: Fri, 18 May 2001 20:54:46 +0000
Subject: Why i can't write to remote file ?
Groups: php.windows 
Request: Send a blank email to php-windows+get-7735@lists.php.net to get a copy of this message
Hi everyone, I write a html page with a form with two parameter; neckties (the unit-cost) and the number of neckties, the action associated to submit is a PHP file "calculate.php" that writes to a remote file "datafile.txt" as follows: : : Total cost of the neckties <?php $result = $neckties * $number; echo $result; $fp = fopen("http://localhost/examples/datafile.txt","w"); if (!$fp) { echo "<p>Unable to open remote file for writing.\n"; exit;} fputs($fp,$result); fclose($fp); echo "total"; echo $result; ?> : : When I call my html page and i give dates (e.g. 30 and 3) and click submit, the file calculate.php runs but i have the message: Total cost of the neckties 90 Warning: fopen("http://localhost/examples/datafile.txt","w") - No error in c:\webshare\wwwroot\examples\calculate.php on line 11 Unable to open remote file for writing. The line 11 is that contains fopen. I have Win98, Apache 1.3.19, PHP4. Where is the problem, inside Apache or inside PHP4. I think inside Apache, but whewre into the httpd.conf file ?? Thank you in advance

« previous php.windows (#7735) next »