Submitting a form at 3 different times using PHP -


sorry if not clear, ill try best make clear possible.

i'v got 2 php files, 1 file called "form.php" has form, , other 1 called "submit.php" action form.

there field called "how many times:" has options(1,2,3), , field called "every:" has options(1 minute, 3 minutes, 5 minutes)

the idea when user select (3 times) , (5 minutes), form submit once every 5 minutes , stop when done submitting 3 times.

is cron job way it? if how?

thank in advance!

there several simple solutions problem. simplest way 1 single cronjob , 1 database.

for database recommend sqlite,it faster implement mysql because there no setup , easy handle.

the database handles data needed run operation, things like: "how many times:" , "every:". , cronjob runs every minute check forms need sent.

of course database needs handle "extra" information work:

  1. id of form job
  2. info saved in form
  3. counter keep how many times form has been submitted
  4. status of form (if still active or done submitting)

at end need 4 files:

  1. "form.php" --> collects info , sends "save.php"
  2. "save.php" --> receives info , saves database
  3. "check.php" --> runs every minute check forms need sent , calls "send.php" every form needs sent.
  4. "send.php" --> receives info , sends it.

all done in 1 single file you.

to send info check.php send.php, simpler send form data in url (catching them get) rather using post method.
must add cronjob call file "check.php" every minute cronjob needs setup once, via control panel or manually on command line.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -