if(!mysql_connect(what_ip?)){
?>
<img src="offline.gif">
<?
}
else {
?>
<img src="online.gif">
<?
}
?>
its based on a simple code that i use to check and show if my forums are online:
CODE
if(!mysql_connect(localhost, ***, ***)){
?>
<img src="http://online.trap17.com/images/status_offline.gif" border="0" height="14">
<?
}
else {
?>
<img src="http://online.trap17.com/images/status_online.gif" border="0" height="14">
<?
}
?>
I dont know if it works with an ip instead of localhost tho, and im not sure if it has to select a db and pass.
Also, if you want to get a whole list of members to be checked, you could use a db for it, selecting $username and $ip from the db for example:
mysql_connect('localhost','db_name','db_password') or die("could not connect to db");
$username= "mysql_query('select username from table')";
$ip= "mysql_query('select ip from table')";
if($username=!$ip){ echo "username doesnt match the ip"; }
else{
$connect= mysql_connect($ip);}
if(!$connect){
echo "<img src=\"offline.gif\">";}
else{ echo "<img src=\"online.gif\">";}
something like that? im a newbie php coder so sorry if it is all wrong
Comment/Reply (w/o sign-up)