I am trying to use a "user online script I found.......Being that I just just spent the last 3 hours searching for an answer, I am posting here. All you have to do is use the "include" function to make it appear, but, it totally jacks up the phhpvms code when you add it(you can't view pages, no other php code will show) things like that.. Here is the code, see if any of you spot a problem.
<?php
//Script created by janssens.org.uk under the GNU GPL
//For help with this please go to: http://janssens.org.uk/repository/php/php-user-online-script/
//Database variables
$server = "localhost"; // Your MySQL Server address. This is usually localhost
$db_user = "****"; // Your MySQL Username
$db_pass = "******"; // Your MySQL Password
$database = "******"; // Database Name
//Customizations
$timeoutseconds = "300"; // How long it it boefore the user is no longer online
//Only one person is online
$oneperson1 = "There is curently"; //Change the text that will be displayed
$oneperson2 = "person online."; //Change the text that will be displayed
//Two or more people online
$twopeople1 ="There are currently"; //Change the text that will be displayed
$twopeople2 ="people online."; //Change the text that will be displayed
//The following should only be modified if you know what you are doing
if($_SERVER['HTTP_X_FORWARDED_FOR']){
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else{
$ip=$_SERVER['REMOTE_ADDR'];
}
$scripturl = $_SERVER[’PHP_SELF’];
$timestamp=time();
$timeout=$timestamp-$timeoutseconds;
mysql_connect($server, $db_user, $db_pass) or die ("Error: Unable to connect to MySQL");
mysql_db_query($database, "INSERT INTO online VALUES ('$timestamp','$ip','$scripturl')") or die("Error: Can't insert data into database'");
mysql_db_query($database, "DELETE FROM online WHERE timestamp<$timeout") or die("Error: Unable to delete old entries from the database");
$result = mysql_db_query($database, "SELECT DISTINCT ip FROM online WHERE file='$scripturl'") or die("Error: Unable to select entries in the database");
$users = mysql_num_rows($result);
mysql_close();
if ($users==1){
echo"<font size=1>$oneperson1 $users $oneperson2</font>";
}
else{
echo"<font size=1>$twopeople1 $users $twopeople2";
}
?>