Alternative to including files remotely in PHP

Associate
Joined
30 Dec 2005
Posts
415
Ok i've been building an API so users can connect to my site to get access to features etc. They put the parameters in the URL, and then use an include or require function to get the contents of that URL.

For E.g.
Code:
<?php
require_once("http://api.routehiker.escouts.net/?routecard&username=john smith&password=test");
?>

That would return some html and css, which would be printed on the user's page...

In theory...

I spoke to my host earlier, and all remote connections have been blocked for PHP. You can't access files remotely. Aaahh!

Anyone had this kind of problem before...is there any way round it? Could it be done with Javascript?

Hope someone can help ASAP!

Cheers,
Rich
 
Soldato
Joined
26 Dec 2003
Posts
16,522
Location
London
You can probably still open regular sockets and thus use Snoopy. Typically, the syntax will be:

Code:
require_once 'snoopy.php';

$snoopy->fetch('http://google.com/');

// You can do anything you want with the results; here we echo them.
echo $snoopy->results;
 
Back
Top Bottom