We had a shoutcast query script on our server that died whenever server 38 crashed. I'm beginning to think its not working because something wasn't setup correctly upon reinstallation but I wanted to run the script through you guys to see if something else may be wrong.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><?php<br /><br />$fp = fsockopen("ct2.fast-serv.com", 8782, &$errno, &$errstr, 30);<br /><br />fputs($fp,"GET /index.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n");<br /><br />while(!feof($fp)) {<br /> Â $page .= fgets($fp, 1000);<br /> }<br /><br />echo $page;<br />?><!--c2--></div><!--ec2--><br /><br />On my local machine, this works fine. It goes to the server, grabs the page, and then spits it back out. Obviously, the data is manipulated after that but for now, I just want to get this part working.<!--content-->
Other than the file pointer not being closed after being used, I see nothing wrong with the script... <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /><br /><br />Try checking the result of the fsockopen() and fupts() calls. Maybe something's going wrong there.<br /><br />:|<!--content-->
Yeah, I know about the closure on there. <br /><br />I think I've found the root of the problem though. I can use fsockopen() all day if I'm just accessing port 80 on a server, but the minute I change that, it won't connect. I'll put in a helpdesk ticket as it seems like the server is blocking requests made to a non-standard port.<!--content-->
That was my guess, too. I just wanted you to check first, before telling you to submit a help desk ticket. Glad you nailed it <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Help desk notified, port opened, works like a charm. <br /><br />Thanks again! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid="" border="0" alt="biggrin.gif" /><!--content-->
Glad you got it working Thumbs Up<!--content-->
Other than the file pointer not being closed after being used, I see nothing wrong with the script... <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/huh.gif" style="vertical-align:middle" emoid=":huh:" border="0" alt="huh.gif" /><br /><br />Try checking the result of the fsockopen() and fupts() calls. Maybe something's going wrong there.<br /><br />:|<!--content-->
Yeah, I know about the closure on there. <br /><br />I think I've found the root of the problem though. I can use fsockopen() all day if I'm just accessing port 80 on a server, but the minute I change that, it won't connect. I'll put in a helpdesk ticket as it seems like the server is blocking requests made to a non-standard port.<!--content-->
That was my guess, too. I just wanted you to check first, before telling you to submit a help desk ticket. Glad you nailed it <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid="" border="0" alt="smile.gif" /><!--content-->
Help desk notified, port opened, works like a charm. <br /><br />Thanks again! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/biggrin.gif" style="vertical-align:middle" emoid="" border="0" alt="biggrin.gif" /><!--content-->
Glad you got it working Thumbs Up<!--content-->