How to disable direct page URL access in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sudhird8184
    New Member
    • Apr 2014
    • 1

    How to disable direct page URL access in PHP

    Hello,

    i am sudhir deshmukh.

    I am working on ERP Web based software, but i am facing a problem, like any user access the any page by using url.

    So how can i disable the Page URL when the user does not access directly.

    Please retrieve my problem. I need help
  • koharu
    New Member
    • Apr 2014
    • 10

    #2
    Ok, well... There are a few methods I can think of.

    Method 1;
    Validate the $_SERVER['HTTP_REFERER'] (This can be spoofed, so it isn't fool-proof)

    Method 2;
    Use Includes within your index.php file (structure your index.php file as a gateway file) and in all files being included, validate that a specific variable has been passed. If it hasn't, spoof an error 404 with PHP.

    Method 3;
    Use Apache Mod_Rewrite to block access to certain php files.

    Comment

    Working...