-------------------------------------------------------------------------------- Hi. Sockets are one thing im very inexperienced with. Ive never had a need to use them, until now. For now, all i need to do is connect to www.example.com and store the page source/html of /index.php into a $variable. I tried using fsockopen() to connect to www.example.com through port 80, and then just did something with fgets(). Anyway, whatever i did, it was wrong, and didnt work. Soooo...anyone able to guide me in the right direction? Thanks in advance for the help Dan.
http://de2.php.net/file_get_contents $theurl="http://www.site.com/"; $filestring=file_get_contents("$theurl") ; PHP: Your host might have disabled it though. Check with them if it fails.
I would suggest cURL, if your host supports it. http://se.php.net/manual/en/ref.curl.php From the comments on above page: <?php $url="http://anything"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $content = curl_exec ($ch); # This returns HTML curl_close ($ch); ?> PHP: