Would it be possible to create a php script that renames a folder on the webserver (in my webspace) and then get it to change data in an SQL database to reflect the folder name it changed and run it via a cron job?
Thanks
Darren
The views expressed on this page by users and staff are their own, not those of NamePros.
Ok, As far as i am aware, it is posible to use php to change a filename . And it would just be a case of saving the filename to a variable and then updating the SQL table. If you gave the script ftp access for example thats how i would do it.
As for a cron job, im not sure how they work having never needed to use one so i can't help you there.
Thanks guys will look into this and see if i can get it to do what i need it to do :D
what do i want to achieve with this...well i want it to change the folder my SWF games are in every 24 hours to stop hotlinkers. I need to take some serious action as im getting abused quite a bit with hotlinkers at the moment and this is what i thought of doing to try and combat it.
This kind of blocking is often realised via the rewrite module (given you are using Apache) by checking whether the referrer contains your domain name. If it does it is likely that the request came originally from your website (it could be faked, but then by the actual end user and not a hotlinker), if it doesnt but something else it came from a hotlinking site, if it is empty, it is either a direct request or the user has configured its client not to send the referrer, then making it impossible for you to determine the request\'s source.
If you nevertheless want to go the rename way you only need to write some code which creates a - more or less - random name, renames the directory with the rename() function and writes it to the database. To let it run daily via cron you only need to add the following line to let it run each day at 10 pm.
Tryed the referer thing via hotlinking and it dont work. Sometimes firewalls etc take out the referer's when your browsing the internet so its not a good method to use really. Hency why i want to create the script.
1 problem with what you wish to do is the fact that the folder would need to have the correct permissions on the filesystem which could result in a security issue.