View Full Version : Strange login problem

03-15-2003, 07:39 PM
I've created the code below to redirect a user to the member page when the sessions are all created. This works when the user has just filled in the login form, submitted it, and they get redirected... but it doesn't seem to redirect if the session already exists (session will already exist if they're a new member and just registered).

// all data filtered and safe to proceed with log in
if($loggedin == "1"){
// old member logging in
$_SESSION['userid'] = $_POST['userid'];
$_SESSION['email'] = $_POST['email'];
// new member logging in - by passed filter process
@mysql_connect($dbhost,$dbuname,$dbpass) || die("Couldn't connect to database");
@mysql_select_db($dbname) || die("Couldn't find database");

$sql = "select username from nm_users where id='$_SESSION[userid]' and email='$_SESSION[email]'";
$result = mysql_query($sql);

$row = @mysql_fetch_array($result);
// redirect all users to selection.php
$_SESSION['username'] = $row['username'];
$redirect = "<META HTTP-EQUIV=\"refresh\" CONTENT=\"4;url=selection.php\">";
$content = 'Logging you in '.$_SESSION[username].'...';

It seems for some reason, the meta refresh tag gets cancelled somehow, but I can't see how :confused:

03-15-2003, 11:08 PM
Nevermind, after a few more tries, I decided to try different browsers than IE6, they all worked fine, so it's something with my IE6