setheroth69 Posted August 1, 2007 Share Posted August 1, 2007 now I'm new to php, and been teaching myself. I found online a class to use with php that allows me to pull information from the XML file on our shoutcast server. The problem I ran into is when I uploaded it to my host, I found out they block the use of fsockopen. I've read up on cURL but still can't wrap my head around it... I have some of the class converted to use cURL but I'm running into a problem around this part: //$fp = fsockopen($this->host, $this->port, $errno, $errstr, 10); $fp = $data; If (!$fp) { $this->_error = "$errstr ($errno)"; return(0); } else { fputs($fp, "GET /admin.cgi?pass=".$this->passwd."&mode=viewxml HTTP/1.0\r\n"); fputs($fp, "User-Agent: Mozilla\r\n\r\n"); while (!feof($data)) { $this->_xml .= fgets($data, 512); } fclose($fp); if (stristr($this->_xml, "HTTP/1.0 200 OK") == true) { // <-H> Thanks to Blaster for this fix.. trim(); $this->_xml = trim(substr($this->_xml, 42)); } else { $this->_error = "Bad login"; return(0); } now I had a small workaround that ended up not working. I kept getting the Bad Login error message. I've searched online for a remedy and well all I could find were posts saying dump the host and find one that allows fsockopen.... If anyone can help me I'd greatly appreciate it, this problem is keeping me from finishing off an integration between the database, the webpage, and the dj's. **I have attached the file (both the pure file and the edited file minus passwords and other sensitive information) for you all to look at. ***Oops forgot, using PHP5 [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/62815-seeking-some-help-php-fsockopen-to-curl-conversion/ Share on other sites More sharing options...
setheroth69 Posted August 1, 2007 Author Share Posted August 1, 2007 *bump* Quote Link to comment https://forums.phpfreaks.com/topic/62815-seeking-some-help-php-fsockopen-to-curl-conversion/#findComment-313232 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.