Hello
Im new to php and i am using a php server status script on my site.
What it does is tells the user wheater or not my shoutcast radio is online.
When i have come to upload it though, i get the 500 Internal Server Error.
Here is my code for the whole page.
[code]
Donk FM - Home<!--header -->
<div id="header">
<h1 id="logo-text"> </h1>
<div id="header-links">
<p>
<a href="index.html">Home</a> |
<a href="index.html">Tune In </a> |
<a href="index.html">Contact</a>
</p>
</div>
</div>
<!-- navigation -->
<div id="menu">
<ul>
<li id="current"><a href="index.html">Home</a></li>
<li><a href="index.html">Tune In </a></li>
<li><a href="index.html">Schedule</a></li>
<li></li>
<li></li>
<li><a href="index.html">Contact</a></li>
</ul>
</div>
<!-- content-wrap starts here -->
<div id="content-wrap">
<div id="main">
<h2><a href="index.html">Schedule</a></h2>
<p class="post-by"> </p>
<table>
<tr>
<th><strong>Date</strong></th>
<th>DJ</th>
<th>Show</th>
</tr>
<tr>
<td>**/**/**</td>
<td><a href="index.html">DJ ***** </a></td>
<td><a href="index.html">Show name </a></td>
</tr>
<tr>
<td>**/**/**</td>
<td><a href="index.html">DJ ***** </a></td>
<td><a href="index.html">Show name </a></td>
</tr>
<tr>
<td>**/**/**</td>
<td><a href="index.html">DJ ***** </a></td>
<td><a href="index.html">Show name </a></td>
</tr>
<tr>
<td>**/**/**</td>
<td><a href="index.html">DJ ***** </a></td>
<td><a href="index.html">Show name </a></td>
</tr>
</table>
<p><br />
</p>
</div>
<div id="sidebar">
<h2>Search</h2>
<form action="#" class="searchform">
<p>
<input name="search_query" class="textbox" type="text" />
<input name="search" class="button" value="Search" type="submit" />
</p>
</form>
<h2>Server Status </h2>
<p><?php
function OfforOn($host, $port, $wait_sec)
{
$fp = fsockopen($host, $port, &$errstr, &$errno, $wait_sec);
if ($fp)
{
fputs($fp, "GET / HTTP/1.0rnUser-Agent:AmIoffOrOnrnrn");
$ret = fgets($fp, 255);
if (eregi("200", $ret))
{
return true;
}
else
{
return false;
}
fclose($fp);
}
else
{
return false;
}
}
echo "The radio is currently ";
if (OfforOn(“audio.str3am.com”, 4080, 1))
{
echo “online”;
}
else
{
echo “offline”;
}
?>
<!-- content-wrap ends here -->
</div>
<!--footer starts here-->
<div id="footer">
<p>
© 2008 <strong><a href="http://donkfm.co.uk">Donk FM</a></strong> |
Hosted By: <strong><a href="http://www.bullsofthosting.co.uk">Bullsoft Hosting</a></strong></p>
[/code]
Am i doing something wrong?
Can someone please help me set it right
Thanks
Tom Bullock