Topic: XML imports accross domain (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: #UK SURREY |
posted 08-17-2006 13:05
I have an external xml file on another domain which i need to import and pass. All the JS solutions i have looked at including AJAX do not seem to work - i belive this to be a security feature with JS imports where the file has to be on the same domain. |
Paranoid (IV) Inmate From: Norway |
posted 08-17-2006 13:33 |
Bipolar (III) Inmate From: #UK SURREY |
posted 08-17-2006 14:55
i wish i knew what a server side script as a proxy was! |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 08-17-2006 17:02
Server side proxy code: $strXmlData = fetchRemoteURL ( "http://otherdomain.com/xmlFile" ); //preferably using curl, though a simple fopen, fread() loop might do header ( "content-type: text/xml" ); print $strXmlData;
|
Bipolar (III) Inmate From: #UK SURREY |
posted 10-24-2006 19:31
OK, following TP's post, I created a php file and included the script above (simply swapping the url with mine) and it did not work - then guessing TP's reference //preferably using CURL I assumed that TP wants me to learn some PHP.... i tried again without much success... |
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 10-24-2006 19:36
Uh, of course fetchRemoteURL needs to be coded by you . code: function fetchRemoteURL ( $strURL ) { $strResult = ''; $fh = fopen ( $strURL, "rb"); if ( $fh ) { while ( !feof ( $fh ) ) $strResult .= fread ( $fh, 8192 ) ; } return $strResult; }
|
Bipolar (III) Inmate From: #UK SURREY |
posted 11-14-2006 13:38
I need to learn some PHP me thinks |
Maniac (V) Inmate From: Boston, MA, USA |
posted 11-14-2006 20:46
I have an example of a proxy script that uses cURL as part of a tutorial on making an RSS reader using Flash (Flash has pretty tight sandbox rules too). I had to use cURL because DreamHost stopped supporting readfile(). You might be able to make some use of it: |