Jump to content

directly try to open or type this URL in browser - Should ask to login


Recommended Posts

 

 

 

Please help . What i want to do is . Say for example : There is a URL

 

www.site.com/post.php

 

when some one directly try to open or type this URL in browser . It should ask user to login in or redirect him to login page and once he is successfully login in then only this page should be visible to him

 

That is if he is not a member then

 

www.site.com/post.php

 

should not be visible to him or her

 

Hi there,

 

Maybe I can help you out a bit here,

 

First and mostly when you use the word "Directly" it can mean that you want a http header authorization approach or you are simply searching for a way to login users. If the first method is what you want to do then head on over to this site and learn more about it.

 

For the user login script, Google provides many tutorials.

It sounds like what you are trying to do is have restricted pages (like a members_area type page). Have you created a login script yet? if so, then you probably use sessions or cookies. Either way you simply check if the session or cookie is set to the correct value, and if not show an error message (like "You must log in to view this page") or simply redirect the user.

 

if you haven't created a user login script then, as phpSensei suggested,  you should consult google for some tutorials

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.