Protecting a particular script...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mightywayne
Forum Contributor
Posts: 237
Joined: Sat Dec 09, 2006 6:46 am

Protecting a particular script...

Post by Mightywayne »

Hello there. I've got a script I run every 12 hours that adds things to a mysql database.

However, all it takes is the server to run the script every 12 hours. I didn't consider someone could figure out the URL and just refresh the script over and over.

So I need a way to block people from doing that, but I'm confused because I think it'd require me to ban user input, but that'd mess with the cron job that does it. Permissions too, I think...

What should I do?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Look at what's in $_SERVER when accessed via cron versus HTTP request.
Post Reply