Jump to content

[SOLVED] Racing simulation


verycleanteeth

Recommended Posts

I'm creating a racing simulation in PHP that I want to run in semi-real time. I'll explain.

 

A bunch of people sign up for a race. They sit and stare at a page that updates about every 10 seconds with the new positions of all the racers and some details about the race.

 

Now the rub. How on Earth do I set up a script that will run every 10 seconds and do what I need it to do? I've read that cron should only be used for things spaced a bit further apart. My service provider specifically requests we don't have any scripts that run within 5 minutes of themselves.

Link to comment
https://forums.phpfreaks.com/topic/48565-solved-racing-simulation/
Share on other sites

you can use a meta refresh tag, or a a javascript refresh, or php header refresh or header location. you can do a google search to get full instructions for each and to decide which is best for you. there are other ways. google is an amazing resource for code

The problem with those solutions is I need this script to run even if no one is actively watching it. If people want they can watch the race "live", or they can wait until it's over and read a transcript of what transpired. If I rely on a javascript refresh or a header refresh, and no one is watching the race happen, nothing will fire.

 

I hope that makes sense.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.