mysql - PHP If Else statement not redirecting correctly? -


i'm trying create if else statement if user isn't logged in send him homepage, otherwise, can go dashboard.php

// check see if user logged in if ($_session['kt_login_id'] == '') {     header( 'location: index.php' ); } else if ($_session['kt_login_id'] != '') {     header( 'location: dashboard.php' ); }; 

in firefox receive error saying page trying redirect in way isn't possible?

it you've written content page

how make redirect in php? states that

you can use header() function send new http header, must sent browser before html or text (so before declaration, example).


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -