Posted by Mike on 11/16/05 03:24
Actually, now i just get:
Warning: fopen(newfile.xml) [function.fopen]: failed to open stream:
Permission denied in /home/ampsof00/public_html/XML/writexmltest.php on line
12
Cannot open file
Warning: fwrite(): supplied argument is not a valid stream resource in
/home/ampsof00/public_html/XML/writexmltest.php on line 13
Cannot write to fileYou have successfully written data to newfile.xml
Warning: fclose(): supplied argument is not a valid stream resource in
/home/ampsof00/public_html/XML/writexmltest.php on line 15
My permissions are 755.
"Mike" <ampeloso@verizon.net> wrote in message
news:MRuef.35701$Vb.12829@trndny05...
> Hello,
> Im doing this in php5, apache
> Im not sure where the problem lies but I have a file
> <?php
> Class CreateXML{
> public function xmlDeclaration(){
> return $varxmlDec = "<?xml version='1.0'> ";
> }
> public function rssDeclaration(){
> return $varrssDec = "<rss version='2.0'>";
> }
> }
>
> ?>
>
>
> THAT IS CALLED BY:
>
> <?php
> include "XmlClass.php";
>
> $test = new CreateXML();
> $varxmlDec = $test->xmlDeclaration();
> $varrssDec = $test->rssDeclaration();
>
> $data = $test->varxmlDec.$test->varrssDec;
> $file = "newfile.xml";
> if (!$file_handle = fopen($file,"a")) { echo "Cannot open file"; }
> if (!fwrite($file_handle, $data)) { echo "Cannot write to file"; }
> echo "You have successfully written data to $file";
> fclose($file_handle);
> ?>
>
> THIS DOES NOT WORK.
> It may have something to do with a .htaccess file.(But I dont think so)
>
>
> If I use: AddHandler application/x-httpd-php4 .php .php4 .php3 .phtml
> .htm .html
> I get a dalog box that asks me if I want to open/download
> writetestxml.php (which is the file I'm accessing)
> I tried using ......-httpd-php5 but the same thing happens.
>
> Help!
> Thanks
> Mike
>
>
[Back to original message]
|