scheols Posted July 30, 2006 Share Posted July 30, 2006 like can someone tell me how 2 set cookies with the specified time and understanding how what time is what. like example[code=php:0]setcookie("id", $user[id],time()+(60*60*24*5), "/", ""); [/code]the 60*60*24*5how does it work?*as u looked i seen time() so ill look that up plz post thanks. Link to comment https://forums.phpfreaks.com/topic/16000-cookies-omg-i-dont-understand-the-math/ Share on other sites More sharing options...
Zane Posted July 30, 2006 Share Posted July 30, 2006 the [code=php:0]time()[/code] function returns[quote]the current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).[/quote]so if you wanted to go 60 seconds from nowyou'd say[code]time() + 60;[/code]lets' say you wanted to go and hour laterwell, an hour is 60 minutes...and you know one minute is 60 secondsso,[code=php:0]time() + (60*60)[/code]so in your case you're going[code=php:0]time() + 60 //One minutetime() + (60*60) //One Hourtime() + (60*60*24) //One Daytime() + (60*60*24*5) //Five Days[/code]hope that helps Link to comment https://forums.phpfreaks.com/topic/16000-cookies-omg-i-dont-understand-the-math/#findComment-65758 Share on other sites More sharing options...
scheols Posted July 30, 2006 Author Share Posted July 30, 2006 yep :) thanks :) Link to comment https://forums.phpfreaks.com/topic/16000-cookies-omg-i-dont-understand-the-math/#findComment-65767 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.