/    Sign up×
Community /Pin to ProfileBookmark

PHP http wrapper error

Hi,
using script below to open and edit xml doc and return to flash doc.

<?php
$file = fopen(“http://www.dropmusic.co.uk/Guestbook/dropguest.xml“, “w+”) or die(“Can’t open XML file”);
$xmlString = $HTTP_RAW_POST_DATA;
if(!fwrite($file, $xmlString)){
print “Error writing to XML-file”;
}
print $xmlString.”n”;
fclose($file);
?>

script is coming up with this error..

Warning: fopen([url]http://www.dropmusic.co.uk/Guestbook/dropguest.xml):[/url] failed to open stream: HTTP wrapper does not support writeable connections. in /home/users/uks10390/html/dropmusic.co.uk/Guestbook/processXML.php on line 2
Can’t open XML file

can anyone advise me how to solve this problem

Skin

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@shmeepsJul 29.2005 — Try using a relative path (../folder/file.ext) instead of an absolute one (http://somedomain.com/folder/file.ext). It seems both are in the same directory, so just use

dropguest.xml

instead of

http://www.dropmusic.co.uk/Guestbook/dropguest.xml

Also check to see that your folder/files is CHMODed correctly to allow writing.

Hope that helps.
Copy linkTweet thisAlerts:
@SkindcauthorJul 29.2005 — I now what you mean about paths but the sendAndLoad is called form a swf embedded in another which makes paths difficult. so I stick to absolute paths as I have tried it both ways.

when I open the uploaded php in my browser i get this error...

[I][FONT=Century Gothic]Warning: fopen(http://www.dropmusic.co.uk/Guestbook/dropguest.xml): failed to open stream: HTTP wrapper does not support writeable connections. in /home/users/uks10390/html/dropmusic.co.uk/Guestbook/processXML.php on line 2

Can't open XML file[/FONT]

[/I]


I have check all permissions as on whole site and individual folder an all is ok to write!

do you understand wht this is telling me because I am not sure.

cheers
×

Success!

Help @Skindc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...