If you have access to crontab on your server, you can make Issvar's script run every x minutes, and write it's output to a file instead. Something along the lines of this:
PHP Code:
<?php
$offbutton = "/images/offbutton.gif";
$onbutton = "/images/onbutton.gif";
$outfile = "/path/to/file.txt";
$fp = fopen ($outfile, 'w');
$ftp_conn=fsockopen('ftp.mysite.com',21,$errno,$errstr,5);
if ($ftp_conn) {
fputs ($fp, $onbutton);
fputs ($ftp_conn,'BYE');
} else {
fputs ($fp, $offbutton);
}
fclose ($fp);
?>
Please not that the file referenced in $outfile has to be writable by the webserver (if calling this script with lynx or wget, etc)
In your crontab, you would place something like this:
1-59 * * * * /path/to/lynx --source
http://your.server.here/updatescript.php
Then, in the page where you want to display this add something like this:
PHP Code:
$myfile = "/path/to/file.txt";
$fp = fopen ($myfile, 'r');
$ftpbutton = fread ($fp, 4096);
fclose ($fp);
If I am not mistaken now, you should be able to use $ftpbutton in some template on that page. If it is a path to an image, like I did in my suggestion here, you would put something like <img src="$ftpbutton"> in your template.
This is yet another untested thingy from me, but in theory (hey, all my stuff works in theory, right

), it should work.