Jump to content

Direct file access.


Aureole

Recommended Posts

How can I determine a person is directly vising my script. I have a cron job that runs a script every x minutes but I want it so the cron job can run the script but if someone types the url in the address bar it doesn't allow them to run it.

 

Thanks!

Link to comment
Share on other sites

So just put the file outside of your www directory, simply put it in your root and update the cron to run it from there.

 

If for some strange reason you don't want to do that, put your php file in a different directory, with a .htaccess that says:

deny from all

This way no one will have access to the file using the regular http protocol, only by using FTP, SSH etc. Your cron will be able to run it this way too.

 

Orio.

Link to comment
Share on other sites

I was thinking about CHMOD but I need to have it so the cron job can run the script but no-one else can and the permissions are for 'User, 'Group and 'Others'... right now the CHMOD is 644.

 

Users can Read and Write. Group can Read and Others can Read.

 

EDIT: Ok thanks a lot Orio.

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.