MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Prevent direct access of script

0
Started on: 04 January 13
Participants: 1

I have a php script which either included by some other scirpt or it is running as a cron.

Due to some resons I have to keep in a webroot folder.

I need a solution by which no one run the script directly as (e.g. http://mysite.com/tt.php)

I have a php script which either included by some other scirpt or it is running as a cron.

Due to some resons I have to keep in a webroot folder.

I need a solution by which no one run the script directly as (e.g. http://mysite.com/tt.php)

This challenge is listed under Open Source and Development & Implementations Community

Related Posts:

PHP

 

CRON script

 

Initiator

Pawan Pandey
Pawan Pandey
  Follow

Give me a computer and leave me alone ... I will be happiest person in this world :)

Please to reply this post
Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.

1 Suggestion

  1. 30 March 13
    0

    Try this

    function yourfun(){ if($_SERVER['REQUEST_URI'] == $_SERVER['PHP_SELF']) { header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); exit; } }

Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top