• 0

ftp indicator...


Question

hi there...

well here is the thing...

is there a way to automatically ping or sth my ftp server from my page every x mins and if it gets some response to indicate that the server is online or offline???

please if someone has seen sth like let me know...it would be great!

thanks in advance

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Yeah, give this a go:

(modify the host and port accordingly)

<?php
$ftplink = @ftp_connect("localhost", 21, 3);
if ($ftplink == False) {
//	Header("Content-Type: image/png");
//	readfile("./offline.png");
	print "Offline";
} else {
	ftp_close($ftplink);
//	Header("Content-Type: image/png");
//	readfile("./online.png");
	print "Online";
}
?>

It'll just print the status as text, but uncomment the commented lines to make it display an image instead (you'll have to make the images though ;))

Edited by pringlex
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.