php reading across different subdomains and ports

Mirlyn

Well-Known Member
I need to grab a line off a remote site to be displayed on mine.

Can fopen work for stupid ports, not just 80?

IE, I need to get a line off http://sub.foo.org:8032/list.html and put it on myplace.org.

I can't seem to get it to work with this:

Code:
<?
$url = "http://sub.foo.org:8032/list.html";
$fp = fopen($url, 'r');
$buffer = fread($fp, filesize($url));
echo $buffer;
fclose($fp);
?>

Works if I copy the html file to the local server (myplace.org), but not if I try to get to sub.foo.org:8032.

Is there another function that'll do this easier? :confuse3: I'll strip html tags anyway, so preserving the markup isn't a requirement.

Thanks! :headbang:
 
What I want to do is pull the Current Song line from my shoutcast server and put it on my site. Like a "now playing" block or something.

Thanks man, I'll look into that. Always up for learning this stuff. :headbang:
 
Back
Top