Jump to content


Photo

Cookies omg i dont understand the math?<time()


  • Please log in to reply
2 replies to this topic

#1 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 30 July 2006 - 07:08 AM

like can someone tell me how 2 set cookies with the specified time and understanding how what time is what. like example

setcookie("id", $user[id],time()+(60*60*24*5), "/", ""); 

the 60*60*24*5

how does it work?

*as u looked i seen time() so ill look that up plz post thanks.
Dont Piss me Off today

#2 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 30 July 2006 - 07:52 AM

the
time()
function returns

the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).


so if you wanted to go 60 seconds from now
you'd say

time() + 60;

lets' say you wanted to go and hour later
well, an hour is 60 minutes...and you know one minute is 60 seconds
so,
time() + (60*60)

so in your case you're going

time() + 60 //One minute
time() + (60*60) //One Hour
time() + (60*60*24) //One Day
time() + (60*60*24*5) //Five Days
hope that helps

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#3 scheols

scheols
  • Members
  • PipPipPip
  • Advanced Member
  • 113 posts

Posted 30 July 2006 - 08:44 AM

yep :) thanks :)
Dont Piss me Off today




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users