Need a simple function - 15$ to the one who first posts it

Namecheap AuctionsNamecheap Auctions
NamecheapNamecheap
SpaceshipSpaceship
Watch
Status
Not open for further replies.

Jawn

Straight from SwedenEstablished Member
Impact
2
I need a simple function.


function ($url,$timeout){




return $pageHtml;
}


I need a function that returns the html source from a specific url.
This can be CURL or fsockopen, it should be able to handle redirects.
Payment will be through paypal.

FOLLOWLOCATION with Curl is broken in latest php versions both php4 and php5.
The function needs to be written in php 4.

Best Regards
Jawn
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I'd expect this to do the trick
PHP:
function getURLContent($url, $timeout)
{
    $oldtimeout=ini_get('default_socket_timeout');
    ini_set('default_socket_timeout', $timeout);
    
    $data=file_get_contents($url);
    
    ini_set('default_socket_timeout', $oldtimeout);

    return $data;
}
 
0
•••
Thanks neroux, works just great, whats your paypal id?
 
0
•••
0
•••
Jawn said:
Thanks neroux, works just great, whats your paypal id?

you can pay him using the donate button :)
 
0
•••
Yeah file_get_contents() is pretty much all you need to do what you want.
 
0
•••
arnold123 said:
you can pay him using the donate button :)

quoted for the laugh
 
0
•••
Status
Not open for further replies.
CatchedCatched

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back