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

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -