title: shoutcast fsockopen
body: <p>Is there anything else for shoutcasts script to read the XML file of it?</p>
  
  <p>I currently have:</p>
  
  <pre><code>&lt;?php
  $open = fsockopen("62.75.171.171","9992"); 
  if ($open) { 
  fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n"); 
  $read = fread($open,1000); 
  $text = explode("content-type:text/html",$read); 
  $text = explode(",",$text[1]); 
  } else { $er="Connection Refused!"; } 
  ?&gt; 
  &lt;/div&gt; 
  &lt;?php 
  if ($text[1]==1) { $state = "Up"; } else { $state = "Down"; } 
  if ($er) { echo $er; exit; } 
  echo "&lt;font face=verdana size=1&gt; 
  Listeners: $text[0] of $text[3] ($text[4] Unique)&lt;br&gt; 
  Listener Peak: $text[2]&lt;br&gt; 
  Server State: &lt;b&gt;$state&lt;/b&gt;&lt;br&gt; 
  Bitrate: $text[5] Kbps&lt;br&gt; 
  Current Song: $text[6]
  Current DJ: $text[13]
  &lt;/font&gt;";?&gt; 
  &lt;?php
  echo "&lt;IMG src='http://thepilotslife.com/images/shows/{$text[13]}.png'&gt;&lt;/img&gt;";
  ?&gt;
  </code></pre>
  
  <p>But gives me these errors:</p>
  
  <pre><code>Notice: Undefined variable: er in C:\xampp\htdocs\stats.php on line 13
  
  Notice: Undefined offset: 13 in C:\xampp\htdocs\stats.php on line 20
  Listeners: 0 of 150 (0 Unique)
  Listener Peak: 1
  Server State: Up
  Bitrate: 128 Kbps
  Current Song: Swedish House Mafia - Greyhound Current DJ: 
  Notice: Undefined offset: 13 in C:\xampp\htdocs\stats.php on line 23
  </code></pre>
  
  <p>What did I do wrong, and is there any other way to do this, since fsockopen is being blocked by the most hosts.</p>