Re: Why i can't write to remote file ?

From: Date: Sat, 19 May 2001 07:03:56 +0000
Subject: Re: Why i can't write to remote file ?
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-7745@lists.php.net to get a copy of this message
Darren wrote: > "m.aprea" <m.aprea@tiscalinet.it> wrote in message > news:3B058C16.4A6E8629@tiscalinet.it... > > 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 > > > I am thinking thatyou don't have right access. Have you tried omitting the > http header" > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Hi Darren, i have tried omitting http, so the line 11 becomes : $fp = fopen("c:/webshare/wwwwroot/examples/datafile.txt","w"); Is does not still work, and when i run it i have the warning message: ------------------------------------------------------------------ Total cost of the neckties 90 Warning: fopen("c:/webshare/wwwwroot/examples/datafile.txt","w") - No such file or directory in c:\webshare\wwwroot\examples\calculate.php on line 11 Unable to open remote file for writing. ------------------------------------------------------------------ I don't understand where is the error ? Thank you in advance

« previous php.windows (#7745) next »