Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6693833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:01:54+00:00 2026-05-26T06:01:54+00:00

I have a page that I want to execute via cron. It just does

  • 0

I have a page that I want to execute via cron. It just does some pretty simple archiving stuff, nothing super high-security, no DB access etc.

Is it a secure practice to simply require a GET var to be present in order to execute the page? So myarchiver.php would be something like:

<?php

$mysecret_word = "abc123";

if ($_GET['secret'] == $mysecret_word){
    // execute my stuff here
}

Then you’d just call myarchiver.php?secret=abc123 in the crontab and the process would run, while any wrong answer or attempt to execute the page with no secret would simply present a blank page (with no extra server load).

I realize this is not “secure” against man in the middle attacks and if the site was compromised– but I believe in general it’s plenty secure to keep this script from being fired by random script kiddies and other idiots who may somehow know about its existence? The thing I’m guarding against is random malicious users who may know about this script bombarding it with requests in order to dos/tie up resources.

EDIT TO ADD: the server is not accessible via SSH and the cron is being executed on a remote machine– so it must be done via an http request.

Thanks for input.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:01:55+00:00Added an answer on May 26, 2026 at 6:01 am

    First off, why not just check the IP address of the server making the request?

    If it has to be done via an HTTP request and simply checking the IP address isn’t an option, you can have your cron run a script similar to “runcron.php”. That script would in turn make a CURL or WGET request to the actual cron script you want to run.

    That would allow you to pass a dynamic hash instead of a static key. That would prevent someone from just repeating the HTTP request if they happen to sniff the traffic. For the hash you could use anything dynamic like the date combined with a salt.

    Example:

    if (md5('secretword') . date('H')) == $_GET['hash']) { // do cron }
    

    That would at least rotate your key once an hour.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that displays messages and I want it to work just
I have an aspx page that I want to convert to an HttpHandler ,
I have links on a ,page that I want to use to jump to
I have a page that displays posts and I want to get the name
I have a page that above it I want to have a panel that
i have a page that contains several submit buttons however i only want one
I have a flash object in my page that i want to make as
I have a page that generates forms depending on user choice. I want to
I have a form on a non-SSL page that I want to submit as
I have a page that requires jQuery.tmpl, but I want to use native knockout

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.