Aureole Posted October 9, 2007 Share Posted October 9, 2007 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! Quote Link to comment Share on other sites More sharing options...
mkosmosports Posted October 9, 2007 Share Posted October 9, 2007 So you basically want noone to have direct web access to your script file? Only the cronjob can run it? Quote Link to comment Share on other sites More sharing options...
Aureole Posted October 9, 2007 Author Share Posted October 9, 2007 Yep that's right. Quote Link to comment Share on other sites More sharing options...
mkosmosports Posted October 9, 2007 Share Posted October 9, 2007 Look into using htaccess files or CHMOD to secure files and directories that you want noone to access. Someone more experienced with that please correct me if Im wrong. Quote Link to comment Share on other sites More sharing options...
Orio Posted October 9, 2007 Share Posted October 9, 2007 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. Quote Link to comment Share on other sites More sharing options...
Aureole Posted October 9, 2007 Author Share Posted October 9, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.