Err, strike that comment.
I guess you didn't request the script, just some help... but hey, I thought it was ugly anyway :)
Main Topics
Browse All TopicsBelow is some neglected code for checking TCP ports with PHP.
http://www.schwebdesigns.c
http://www.schwebdesigns.c
However I keep getting the following errors.
Can someone who has experience with fsocketopen function take a look at this?
I'm not sure why it cannot modify the header info, that's a new one to me.
Notice: Undefined variable: link in e:\inetpub\www\intranet\st
Notice: Undefined offset: 1 in e:\inetpub\www\intranet\st
Warning: Cannot modify header information - headers already sent by (output started at e:\inetpub\www\intranet\st
PS if anyone knows of another PHP script that can monitor TCP ports and is reliable, please let me know.
This is the only script I came across after hours of looking.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: ASCII_Man {http:#8157543}
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
snoyes_jw
EE Cleanup Volunteer
Business Accounts
Answer for Membership
by: ASCII_ManPosted on 2003-03-18 at 00:02:41ID: 8157543
Here's a completely modified version that will do what you want.
om/ e.com/Web/ Web_Langua ges/PHP/ Q_ 20554037.h tml
e.gif"; d.gif";
Just save is as status.php in the same directory as the original and update the server address specific setup lines as usual.
------------------
BEGIN status.php
------------------
<?php
//
// Modified Web Server Status v 1.2, Copyright 2002 By Ryan Schwiebert, visit http://www.schwebdesigns.c
// See http://www.experts-exchang
//
//
// BEGIN SETTINGS
//
//Please change to your server specifications
//
$live = "http://tech_01/status/liv
$dead = "http://tech_01/status/dea
$defaultPort = 80;
$separator = ':';
$waitTime = 5;
// END SETTINGS
$link = $HTTP_GET_VARS['link'];
if($separator == ':'){
if(strstr($link, $separator)){
if(substr($link, 0, 6) == 'http://'){
list($URI, $port) = explode($separator, substr($link, 6, 0));
}
else{
list($URI, $port) = explode($separator, $link);
}
}
else{
$URI = str_replace('http://', '', $link);
$port = $defaultPort;
}
}
else{
list($URI, $port) = explode($separator, $link);
}
if(empty($port)){
$port = 80;
}
//Test the server connection
$checkURI = @fsockopen(server($URI), $port, $errno, $errstr, $waitTime);
if($checkURI){
header("Location: $live");
// echo 'good';
}
else{
header("Location: $dead");
// echo 'dead';
}
function server($addr){
if(strstr($addr,"/"))
$addr = substr($addr, 0, strpos($addr, "/"));
return $addr;
}
?>
------------------
END status.php
------------------
I'd also suggest that you award more points for a thread where you request someone to write a script for you.