Lets just back up a bit. Keep a back-up copy of your current members.php page. Then copy the code below and paste that into a new Dreamweaver document and save it as members.php - sign in to the page and see what happens. ?php require_once('Connections/democon.php'); ?> <?php //initialize the session if (!isset($_SESSION)) { session_start(); # set an expire to 5 seconds for testing define('IDLE_MAX', 5); $msg = ''; if (!isset($_SESSION['MM_Username'])) { # new session $_SESSION['MM_Username'] = (object) ['id'=>123, 'timestamp'=>time()]; $msg = '<p>User had no session, new session created.</p>'; } else { # does the idle time exceed the max seconds? if ((time() - $_SESSION['MM_Username']->timestamp) > IDLE_MAX) { # yes, log them out.. unset($_SESSION['MM_Username']); session_write_close(); $msg = '<p>User has expired session.</p>'; } else { $msg = '<p>Users session exists and is valid, updating timestamp.</p>'; $_SESSION['MM_Username']->timestamp = time(); } } } ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_Recordset1 = "-1"; if (isset($_SESSION['MM_Username'])) { $colname_Recordset1 = $_SESSION['MM_Username']; } mysql_select_db($database_democon, $democon); $query_Recordset1 = sprintf("SELECT * FROM portal WHERE idno = %s", GetSQLValueString($colname_Recordset1, "int")); $Recordset1 = mysql_query($query_Recordset1, $democon) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!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="refresh" content="60; url=login.php"> <title>welcome</title> </head> <body> <?php print $msg; ?> <p style="font-size: 18px"> </p> <p style="font-size: 18px">Welcome <span style="color: #F00"><?php echo $row_Recordset1['firstname']; ?></span> <span style="color: #F00"><?php echo $row_Recordset1['surname']; ?> !</span> You are now login into the member area.</p> <p> </p> <table width="356" height="127" border="0" align="center" cellpadding="6"> <tr> <th colspan="2" bgcolor="#FFFFCC" scope="row">YOUR PROFILE</th> </tr> <tr> <th width="134" align="left" bgcolor="#FFFFCC" scope="row">ID NO</th> <td width="342" bgcolor="#FFFFCC"><?php echo $row_Recordset1['idno']; ?></td> </tr> <tr> <th align="left" bgcolor="#FFFFCC" scope="row">SURNAME</th> <td bgcolor="#FFFFCC"><?php echo $row_Recordset1['surname']; ?></td> </tr> <tr> <th align="left" bgcolor="#FFFFCC" scope="row">FIRST NAME</th> <td bgcolor="#FFFFCC"><?php echo $row_Recordset1['firstname']; ?></td> </tr> <tr> <th align="left" bgcolor="#FFFFCC" scope="row">EMAIL</th> <td bgcolor="#FFFFCC"><?php echo $row_Recordset1['email']; ?></td> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p> <p><a href="<?php echo $logoutAction ?>">LOG OUT</a></p> <p> </p> <p> </p> <p> </p> </body> </html> <?php mysql_free_result($Recordset1); ?>
... View more