Thanks Ishan,
That site was very useful, but I don't have access to the file that
needs to be edited, so I need to use a PHP proxy.  The proxy doesn't
work, so I will post my code and see if anyone can crack the code. I
have entered the url proxy.php?path=http://live.nhl.com/data/
scr20053.txt?i=1192150735281, which shows a blank page, directly
accessing the url shows this 
http://live.nhl.com/data/scr20053.txt?i=1192150735281
<?php
// Hardcode the hostname
define('HOSTNAME', 'http://live.nhl.com');
// Get the REST call path from the AJAX application
$path = $_GET['path'];

// The URL to fetch is the hostname + path
$url = HOSTNAME.$path;
// Open the Curl session
$session = curl_init($url);
// Don't return HTTP headers. Do return the contents of the call
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
// Make the call
$xml = curl_exec($session);

// The web service returns XML
header("Content-Type: text/xml");

echo $xml;
curl_close($session);
?>

On Oct 11, 1:12 pm, "Ishan Anand" <[EMAIL PROTECTED]> wrote:
> Kris,
>
> You might find it easier to do this using Apache's built in mechanisms to
> build a reverse proxy than using PHP. For an example 
> visit:http://premshree.livejournal.com/66129.html
>
> Best,
> Ishan
>
> On 10/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > How would you recommend going about redirecting the requests. I have
> > basically go experience with PHP (other that echo). I would appreciate
> > if you could help me out, but if not I'm sure I would be able to find
> > something about it on Google.
>
> > On Oct 11, 11:44 am, craig <[EMAIL PROTECTED]> wrote:
> > > Unless the NHL data and your web app are served from the same domain,
> > > you cannot do an XMLHTTPRequest.  For security, so-called "cross-site"
> > > requests are not allowed (ie, a web app served from mydomain.com
> > > cannot do an XMLHTTPRequest for data from yourdomain.com).  You
> > > somehow will need to host the data on your own site (same domain as
> > > where the app lives), or use PHP/etc to redirect local requests to the
> > > NHL site.  This is a fairly common, but easily handled, limitation of
> > > using XMLHTTPRequest.  It just requires some server-side workarounds.
> > > For my app, I use PHP to handle it.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to