How to execute PHP file with parameters automatically?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luftikus143
    New Member
    • Jan 2007
    • 97

    How to execute PHP file with parameters automatically?

    Hi there,

    I need to (re)create every couple of days a few dozen SVG files, which are created through the same PHP file, passing four parameters. I have programmed the generic PHP file so that it overwrites already created files after, say, 7 days.

    But at the beginning (after having changed any coding in the PHP file) I have to launch those three dozen files always by hand. Instead I would like to use a script which would launch one file (with a 30 second break in-between, as the generation of each file takes quite some time) after another, including those parameters.

    Is that possible, and how would I do that?

    Thanks for any hints!
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    change your PHP code so that it doesn't need "already created files", and just creates them if they're not there.

    Give us an example of this script is used. I'm not clear on your problem.

    Dan

    Comment

    • luftikus143
      New Member
      • Jan 2007
      • 97

      #3
      Thanks for the reply. The code does indeed create the files if they are not there. But it does it only when a user clicks on one of the many "links" (better, the four different options), which then calls the SVG file. If the SVG is not there, it will be created. But I would like to create them at the first instance, because I don't want the user to have to wait for 30 seconds or even a minute, which is the time to create the file. Once created, the next user then gets the cached file will, which only takes a second.

      So, instead to be forced to manually launch these files one by one so that they are created, I would like to use a code in the style:

      CREATE svg file with parameters x,y,z
      WAIT 30 seconds
      CREATE svg file with parameters x1,y,z
      WAIT 30 seconds
      CREATE svg file with parameters x,y1,z
      WAIT 30 seconds
      ....

      Cheers.

      Comment

      Working...