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! Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/ 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? Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/#findComment-365446 Share on other sites More sharing options...
Aureole Posted October 9, 2007 Author Share Posted October 9, 2007 Yep that's right. Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/#findComment-365485 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. Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/#findComment-365498 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. Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/#findComment-365503 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. Link to comment https://forums.phpfreaks.com/topic/72469-direct-file-access/#findComment-365505 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.