How I set the var:
$_SESSION['logged'] = 1;
How I check the var:
Code: Select all
<?php
session_start();
if(!isset($_SESSION['logged'])) {
header("Location: index.php");
}
?>
Moderator: General Moderators
Code: Select all
<?php
session_start();
if(!isset($_SESSION['logged'])) {
header("Location: index.php");
}
?>
Please rephrase that.ScottCFR wrote:it won't let the session log anymore.
What are you expecting to happen?ScottCFR wrote:it just simply redirects me to index.php.
Code: Select all
echo "<p><font color='green'>You have logged in successfully. <a href='/admin/home.php'>Click Here</a> to go to the admin area</a></font></p>"; Code: Select all
<?php
session_start();
if (empty($_SESSION['logged'])) {
header('Location: passlist.php');
exit();
}
session_unset();
session_destroy();
include("dbinfo.inc.php");
mysql_connect($servname,$dbusername,$dbpassword);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM ($newdbname) ";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$user_id=mysql_result($result, $i, "user_id");
$username=mysql_result($result,$i,"username");
$password=mysql_result($result,$i,"password");
echo "$username, $password, $user_id";
?>
<form action="updated.php">
<input type="hidden" name="user_id" value="<?php echo "$user_id"; ?>">
Username: <input type="text" name="username" value="<?php echo "$username"?>"><br>
Password: <input type="text" name="password" value="<?php echo "$password"?>"><br>
<input type="Submit" value="Update" name="submit">
</form>
<?php
++$i;
}
?>Code: Select all
if (empty($_SESSION['logged'])) {Code: Select all
if (!isset($_SESSION['logged'])) {