[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Timimg in php

Posted on 2003-11-19
5
Medium Priority
?
273 Views
Last Modified: 2008-03-06
I want to write the script that allow user to playing the simple puzzle game but the amount of time. For example the game start at 10:30 and support to be finished 2 hours later i.e 12:30 after that time the score will not be calculate. Could anyone tell me how to implement such a thing. Thank you
P/s i already wrote the game i just need to do the calculating score system.
0
Comment
Question by:jany2222
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
spearman123 earned 100 total points
ID: 9784133
0
 
LVL 1

Expert Comment

by:spearman123
ID: 9784151
look through there.. figure out how to find time and :

startTime = ....;
endTime = startTime + 120;
do {
/* game code */
nowTime = ....;
} while (nowTime < endTime);
0
 
LVL 1

Assisted Solution

by:show_source
show_source earned 100 total points
ID: 9786461
Or use time() and sessions
<?php
session_start();

do{
$_SESSION["startSec"] = time();
/* game code */
}
if($_SESSION["startSec"] < (60*60*2) {
ok
}

Instead af sessions, you could set a cookie

And with some Javascript you could show the  time there's left to play
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question