Unstoppable Domains

Is this possible?

Spaceship Spaceship
Watch

dc1pop

VIP Member
Impact
13
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
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
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.


EDIT: I just googled this and got you this link: http://uk.php.net/ftp It also leads off to this: http://uk.php.net/manual/en/function.ftp-rename.php which is renaming a file via the php ftp functions.

Hope this helps you =]
 
0
•••
Yes, this would be possible. What do you want to achieve with that?
 
0
•••
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.
 
0
•••
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.
Code:
0 22 * * * /path/to/your/script.php
 
Last edited:
0
•••
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.

Thanks ofr your help!
 
0
•••
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.
 
0
•••
hmm..thanks for letting me know. I look into it all and see whats best then. Thanks
 
0
•••
To add on, there is a function called rename(oldname, newname)

You can always try to chmod the folder first.

Remember to strip ./ and ../ from user input.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back