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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.