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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -