Page 3 of 3

Posted: Thu May 19, 2005 1:52 pm
by Parody
$time = date("d:H:i:s") + 200;
print "$time";

If I do that, at this current time I get 219

Posted: Thu May 19, 2005 1:57 pm
by Parody
Warning: mktime() [function.mktime]: Windows does not support negative values for this function in c:\program files\apache group\Apache\htdocs\timecheck.php on line 2
-1

Hmm...

This is the code:


Code: Select all

$time  = mktime(0, 0, 0, date(&quote;d&quote;),  date(&quote;H&quote;), date(&quote;i&quote;)+2,  date(&quote;s&quote;));
print &quote;$time&quote;;
I honestly have no idea :(

Posted: Thu May 19, 2005 2:18 pm
by Parody
$time = mktime(0, 0, 0, 0, date("d"), date("H"), date("i")+2, date("s"));
print "$time";

I didn't have enough of: 0,

But I still get this error:

Warning: Wrong parameter count for mktime() in c:\program files\apache group\Apache\htdocs\timecheck.php on line 2

Posted: Thu May 19, 2005 2:19 pm
by Parody
Oh, sorry, line 2 is this one:

$time = mktime(0, 0, 0, date("d"), date("H"), date("i")+2, date("s"));

Posted: Thu May 19, 2005 6:40 pm
by Burrito
are you still trying to figure out how to insert the time to the db? I got lost when you started working with mktime...

I thought your goal was to insert the time to the db with some seconds added to it?

if that's still your plan here's a hint :wink: :

Code: Select all

mysql_query("insert into... '".date("h:i:s",strtotime(...
I know it's a bone, but that's the best way to learn, do it yourself...

Posted: Fri May 20, 2005 10:29 am
by Parody
I finished it, at last.

Thanks for all your help.

I eventually just added the 'current time' to the database, and upon loading the page the next time it would check if that time was 120 seconds ago, if not then die and display a message.