session_start()
Posted: Fri Apr 08, 2005 9:45 am
I built a authentication database with MySQL 5.0.3 and PHP 4.3.12 dev using Apache2 and when I get to login page and submit my user and pass the database sees my authentication, but then i am supposed to go to anoth session of the site. Instead the login session keeps looping back to login again. I need help...
Thanks
feyd | Please review how to post code using
Thanks
Code: Select all
<?php
session_start();
if ((isset($_SESSIONї'admin_logged']) &&
$_SESSIONї'admin_logged'] != "e;"e;) ||
(isset($_SESSIONї'admin_password']) &&
$_SESSIONї'admin_password'] != "e;"e;)) {
include "e;logged_admin.php"e;;
} else {
include "e;unlogged_admin.php"e;;
}
?>Code: Select all
<?php
$conn = mysql_connect("e;localhost"e;, "e;some_user"e;, "e;some_pass"e;)
or die(mysql_error());
$db = mysql_select_db("e;some_db"e;)
or die(mysql_error());
?>Code: Select all
<?php
if ((isset($_SESSIONї'admin_logged']) &&
$_SESSIONї'admin_logged']) != "e;"e; ||
(isset($_SESSIONї'admin_password']) &&
$_SESSIONї'admin_password'] != "e;"e;)) {
//Do Nothing!
} else {
$redirect = $_SERVERї'PHP_SELF'];
header("e;Refresh: 5; URL=admin_login.php?redirect=$redirect"e;);
echo "e;You are currently not logged in, we are redirecting you, "e; .
"e;be patient!<br>"e;;
echo "e;(If your browser doesn't support this, "e; .
"e;<a href=\"e;admin_login.php?redirect\"e;>Click here</a>"e;;
die();
}
?>feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]