Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cURL, or soemthing just to get a URL please :D 1

Status
Not open for further replies.

youradds

Programmer
Jun 27, 2001
817
GB
Hi,

I'm a perl programmer normally - but I'm having to use PHP on a job.

I can't seem to find the PHP equivelant of a perls LWP::Simple::get() function

What I need is something like:

<?
$url = ' echo get($url);
?>

Is this even possible? I've been through a TON of stuff on Google, as well as even the PHP sites - but cos I'm not 100% sure what I'm looking for, I still havn't found a solution :'(

TIA for any suggestions!

Andy
 
sure.
use

Code:
$contents = file_get_contents('[URL unfurl="true"]http://www.domain.com/path/to/file/php');[/URL]

note that you have to have allow_url_fopen turned on in php.ini. i believe that this is the default.

some sites will feed duff content back as the referrer or site cookie is not set. a sort of anti-screen-scraping method. there are ways around this if needs be. although you should ask yourself whether bypassing the 'security' controls in such a manner is permitted by the site-owner and therefore whether you _should_ employ such methods. post back if you need.
 
Hi,

Thanks - I don't think thats enabled :( (tried that before)

Is there any other way?

TIA!

Andy
 
Nope, its a shared server - and they won't let you make changes like that :(

TIA

Andy
 
My appologies - it is enabled - and works like a charm :) (not sure why it didn't work before - but hey-ho - the joys of servers LOL)

Thanks for your help!

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top