Posted on Wednesday 4th July 2007 at 09:09 PM
When I log out, and press ctrl + r (f5), the "total members" says that there are 2 members at the site. But, that second person is actually the first member that have ever registered, its just a copy. Thats happend all the time. When I'm logging out the stat are adding one more member (again only a copy of the 1. member.)
logout.php
online.php
logout.php
PHP Code
<?php session_start(); //allows session include "config.php"; echo "<center>"; //checks there trying to logout if(isset($_GET['logout'])){ //deletes the sessions unset($_SESSION['id']); unset($_SESSION['password']); //loggedout message echo "You are now logged out."; } echo "<center>"; ?>
online.php
PHP Code
<?php include("config.php"); //Query database & Counts the rows in the members database $count = mysql_num_rows(mysql_query('SELECT * FROM `members`')); echo $count; //Displays the total members $new = mysql_fetch_array(mysql_query("SELECT * FROM `members` ORDER BY `id` DESC LIMIT 0, 1")); //Gets the newest member echo "Newest User: " . $new[username]; //Displays the newest member ?>