hi all ~
Got a bit of a problem here, I'm writing a page (well, more like modifying
some code I found ;) ) and the PHP sections appear to be ignored by both
netscape and IE. I'm not sure if it's something with my code, or a lack of
PHP exentions on the apache server that it will be placed on.
I'm copying the whole page worth of HTML into this doc (hope it isn't TO
long.)
Also, for some reason, hotmail doesn't like "< or > or " " tags being copied
from anyplace else, so I get thousands of "&al; or > or "" ... sorry
...
:-/
Any help would be wonderful! Thanks in advance all!
The code (the original, unedited version):
<?php
error_reporting (E_ALL);
/* Allow the script to hang around waiting for connections. */
set_time_limit (0);
$telnetclient = "zeth";
$remotehost[0] = "abandonedrealms.net";
$remoteport[0] = "9000";
$remotehost[1] = "cnn.com";
$remoteport[1] = "80";
$remotehost[2] = "freebsd.org";
$remoteport[2] = "80";
$c = count($remotehost);
$c2 = count($remoteport);
if($c != $c2){
die("You must have both remoteport and remotehost specified for all
servers.");
}
?>
<html>
<head>
<title>Zeth's server status checker</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100" border="1"
cellspacing="0" cellpadding="0"
bordercolor="#000000">
<tr>
<td>
<table width="291" border="0"
cellspacing="0" cellpadding="0">
<tr bgcolor="#00CCFF">
<td><b><font color="#FFFFFF"
face="Verdana, Arial, Helvetica, sans-serif"
size="2">Server
name</font></b></td>
<td><b><font color="#FFFFFF"
face="Verdana, Arial, Helvetica, sans-serif"
size="2">Status</font></b></td>
</tr>
<?php
for ($i = 0; $i < $c; $i++) {
$fp = fsockopen("$remotehost[$i]", $remoteport[$i], $errno,
$errstr);
if (!$fp) {
?>
<tr bgcolor="#FFFFFF">
<td><font color="#000000" face="Verdana,
Arial, Helvetica, sans-serif" size="1"><?php echo
$remotehost[$i].":".$remoteport[$i]; ?></font></td>
<td>
<div align="center"><font
color="#000000" face="Verdana, Arial, Helvetica,
sans-serif" size="1">DOWN</font></div>
</td>
</tr>
<?php
} else {
?>
<tr bgcolor="#FFFFFF">
<td><font color="#000000" face="Verdana,
Arial, Helvetica, sans-serif" size="1"><?php echo
$remotehost[$i].":".$remoteport[$i]; ?></font></td>
<td>
<div align="center"><font
color="#000000" face="Verdana, Arial, Helvetica,
sans-serif" size="1">UP</font></div>
</td>
</tr>
<?php
fclose ($fp);
}
}
?>
</table>
</td>
</tr>
</table>
</body>
</html>
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php