Jump to content
MakeWebGames

session not redirecting to next page


PHPDevil
 Share

Recommended Posts

I didn't think this was suppose to be difficult but i've made a mess of something which I think is straight forward O,o

Issue is on my login page, if the username and password is right, that user doesn't get redirected. O,o

 

if ($hash == $dbpass)
{
	$error_string .=  'Authentication succeeded';
	$_SESSION['login'] = "1";
	$_SESSION['username'] = $username;
	$_SESSION['email'] = $email;
	$_SESSION['ID'] = $id;
	header('Location: loggedin.php');


}

 

I do have session_start(); at the top of my login page.

The loggedin page has just this

 

<?php
session_start();
require "corefolder/globe.php";
if(empty($_SESSION['login']) || empty($_SESSION['username'])  || empty($_SESSION['email'])  || empty($_SESSION['ID']))  
{
header('location: login.php');
die();
}
?>

 

 

globe.php is just my database connection. thats fine

Should mention that i did comment out the if statement in loggedin for debugging but still no luck

Edited by PHPDevil
forgot something
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...