500 Internal Server Error

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">&nbsp;</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">&nbsp;</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>
	&copy; 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 :D

Thanks
Tom Bullock

It’s probably a server configuration issue. PHP doesn’t produce HTTP 500 errors as far as I know. You should consult your host about this.

I think it is the script because i had a php page before and i missed a syntax out. That gave me the 500 Internal Server Error, and i had to check my error log. When i checked my error log, it said what i had done wrong in my script.

However, you may still be right, so i will check with my host.

Sponsor our Newsletter | Privacy Policy | Terms of Service