Jump to content


Photo

Running scripts automatically


  • Please log in to reply
4 replies to this topic

#1 spelltwister

spelltwister
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 28 February 2006 - 07:33 PM

Hey guys and gals,

Here's my problem. I just finished programming an online game and I have some php script that generates xml files. Well, to do this, I type in the address of the file on the server and pass it to variables in the addressbar. It then queries a database and does everything fine and dandy. Problem is, I need it to do that automatically. I cannot be sitting at my computer 24-7 typing stuff in the address bar. Is there a way I can run the php script and pass those variables automatically?

Thanks a bunch, this is the last thing I need to do :-D.

Mike

#2 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 28 February 2006 - 08:25 PM

Look into cron

[a href=\"http://www.hotscripts.com/PHP/Scripts_and_Programs/Guestbooks/more4.html\" target=\"_blank\"]http://www.hotscripts.com/PHP/Scripts_and_...ooks/more4.html[/a]

Lite...

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#3 spelltwister

spelltwister
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 01 March 2006 - 07:27 PM

Hello, I've looked into cron, but from what I can gather, it works like this:

You can have it do a number of things automatically, but not actually.. run? a web page. I'm not sure what you'd call that, but what I need it to do is actually.. hit? the page with one variable (origianlly I thought it was two, but only one is necessary) so it does updates to the database. If I'm misunderstanding cron, please let me know. Thanks

Mike

#4 dcole07

dcole07
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 01 March 2006 - 07:44 PM

Well you can have it run programs for you... so you can tell it to open FireFox at 9:08.
You could also have it run a task when an even happens... like have a page tell it to run the xml (or what ever your putting in the address bar...)

So a user will go to a page, that will make the cron run (there are other programs like it... cron is for Unix computer basicly) and cron will open your brower and go to a URL...

#5 spelltwister

spelltwister
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 01 March 2006 - 07:54 PM

After doing some looking around on this site for other questions regarding cron, I'm going to have to just try a few things.

I guess my new question would be, is there a way to dynamically create cron jobs?

Here's what I need. I have 1 php file that will run fine from the address bar with the variable passed to it. What I need, since it's an online gaming site, is for it to update a set number of games per day. For example, I have games 1-10 full of players playing a game. I want game 1,2 to update on monday, game 3,4 to update tuesday, etc. But I need the cron job to be created when I "launch" the game to the public. So... is there a way to do that? Thanks so much.

Mike




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users