Pls Friends what happy to this below code, it keep on telling me session expire lol
<?php define('WAP',true); require('db.php'); session_start(); $ses = $_SESSION['ses']; $sessions = mysql_fetch_array(mysql_query("SELECT * FROM sessions WHERE ses = '$ses'")); $time = time(); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/> <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/> <meta http-equiv=\"Cache-Control\" content=\"must-revalidate\"/> <meta http-equiv=\"Cache-Control\" content=\"max-age=30\"/> <title>Home</title> </head> <body>"; if (mysql_num_rows(mysql_query("SELECT * FROM sessions WHERE ses = '$ses'")) == 1) { if ((time()-$sessions['time']) < 300) mysql_query("UPDATE sessions SET time = $time WHERE uid = $sessions[uid]"); } else { echo "Your session has expired <form action=\"index.php\" method=\"get\"> <input type=\"submit\" value=\"Index\"/> </form> </body> </html>"; exit(); } mysql_query("UPDATE members SET lastseen = $time WHERE id = $sessions[uid]")or die(mysql_errno()." - ".mysql_error()); echo "welcome please feel free to look around. <form action=\"logout.php\" method=\"get\"> <input type=\"submit\" value=\"Logout\"/> </form> </body> </html>"; ///////////////////////////database CREATE TABLE `sessions` ( `uid` int(100) unsigned NOT NULL auto_increment, `user` varchar(50) default NULL, `ses` varchar(50) default NULL, PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7session error
Started on the old forum in August 2010 · view the original in the archive · old links redirect here
there is no time field in your database table
if ((time()-$sessions['time']) < 300) mysql_query("UPDATE sessions SET time = $time WHERE uid = $sessions[uid]");
Maybe... Or Check ur login php. Maybe there's problem..
Visit my WEBSITE Project: http://www.aspirewap.net