redirect - Reference Redirection in PHP -


this question has answer here:

i've redirected user if directly try access web pages without login. directly want open page after login, user has tried open before login.

suppose user has tried open reports.php without being logged in, first redirected login page, after login want redirect user directly on reports.php, tried open. code should implement in php files?

once see user anonymous , redirect him login page - add additional parameter script/page name. after successful login redirect user page.

for example, user wants access profile.php secured. make

header("location: http://example.com/login.php?redirect=profile.php"); die(); 

at login.php make him go with:

header("location: http://example.com/".$_get['redirect']); die(); 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -