Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Newbie- Server Check

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Postby Unknown » Sat Mar 08, 2003 12:15 pm

Why not use Perl???
Unknown
New php-forum User
New php-forum User
 
Posts: 9
Joined: Mon Jan 13, 2003 10:33 am

Postby nick_k » Sat Mar 08, 2003 12:30 pm

Code: Select all
<html>
<head>
  <title></title>
</head>

<body>

<?php

$server = "hostlive.co.uk";
$port = 80;

$fp = fsockopen ($server, $port);

if(!$fp)
{
$msg = "your message here";
mail("your email here", "subject here", $msg);
} //end if

?>

</body>
</html>


very simple script, it attempts to connect to port 80 of "hostlive.co.uk" on port 80, if its unsuccesful, it emails you.
Sorry, but i dont know how you can get the time it takes to connect, but im sure its possible.
nick_k
New php-forum User
New php-forum User
 
Posts: 34
Joined: Wed Dec 25, 2002 6:04 am
Location: The Netherlands


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron