deny direct access to a php file by typing the link in the url

Posted by aeonsleo on Stack Overflow See other posts from Stack Overflow or by aeonsleo
Published on 2010-05-04T22:50:45Z Indexed on 2010/05/04 23:08 UTC
Read the original article Hit count: 212

Filed under:
|

hi, I am using php session for a basic login without encryption for my site. I want to prevent a user from directly accessing a php page by typing the url when he/she is not signed in. But this is not happening. I am using session_start(), initializing session variables and aslo unsetting and destroying sesssion during logout. Also if I type the link in a different browser the page is getting displayed. I am not very well versed with php , only a beginner. I googled for such problem and found few alternatives as keeping all files in a seperate folder from the web root, using .htaccess etc. Can someone explain in simple terms what could be a good solution.thanks in advance.

© Stack Overflow or respective owner

Related posts about php

Related posts about session