Jump to content

PHP Header Login Page Location


simpjd

Recommended Posts

I'm making a web page that has restricted access via a login script.

 

If the user is not logged in I use "header("Location: http://www.example.com");" to redirect the user to another "safe" page.

 

My question is, is this safe? Can the user somehow stop or bypass the header and view the page without logging in for the client side?

 

I would appreciate any help.

 

Jack

Link to comment
https://forums.phpfreaks.com/topic/157704-php-header-login-page-location/
Share on other sites

I'm making a web page that has restricted access via a login script.

 

If the user is not logged in I use "header("Location: http://www.example.com");" to redirect the user to another "safe" page.

 

My question is, is this safe? Can the user somehow stop or bypass the header and view the page without logging in for the client side?

 

I would appreciate any help.

 

Jack

 

Put an exit after it in order to make sure that nothing gets loaded.

 

header("Location: http://www.example.com");

exit;

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.