Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

Setting an Expiration Date & Time with PHP

Ads
banner
banner
banner
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#1
Senior Member
I need PHP expiration date and time for my conditional code? I have the basic understanding how PHP works but I am not very good at PHP coding anyways please just post the format for.

1. PHP Expiration Date (expires 22/01/2014)
2. PHP Expiration Times (expires in 1 minute, 1 hour, 1 day)
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#2
Posting Freak
Without actually providing the code you're trying to add this into it would just be a guess and probably wont be a direct enough example for you to sort out.

Here is a start http://www.w3schools.com/php/func_http_setcookie.asp
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#3
Support Team
The rule is: 60 second, 60 minutes, 24 hours, 365 days. So now that you know the formula it's easy to set expiration time.

PHP Expiration Times (expires in 1 minute, 1 hour, 1 day)

60*1 = 1 min (60 seconds (1 min) times 1 minute)
60 * 60 * 24 = 1 day (60 seconds (1 min) times 60 minutes times 24 hours)
60*60*24*365 = 1 year (60 seconds (1 min) times 60 minutes times 24 hours times 365 days)

PHP Code:
$expiry date("Y-m-d"time() + 60*60*24*365 ); 


PHP Expiration Date (expires 22/01/2014)

The formula is 0000-00-00 which is basically date (Year - Month - Day);

PHP Code:
$expiry date("2014-01-22"time()); 
antony Offline referral

Posts: 478
Joined: Jul 2013
Reputation: 5

#4
Senior Member
Thanks I really appreciate your help. PHP Expiration looks very straightforward
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#5
Posting Freak
Still if you actually posted the code you could get more helpful replies. While both will do what you want. There might be better ways to integrate into what you are using. These replies do no more than if you would have just typed your question in google.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
invisibe_dude Offline referral

Posts: 820
Joined: May 2013
Reputation: 24

#6
Posting Freak
If you don't want to share your PHP code with everybody just PM me your code and I will take a look at it. Don't wary I will not steal it LOL
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#7
Posting Freak
Sharing privately does nothing to help this community and goes against why we use the forum. If he does not want to share it publicly its on him to sort out his own problems. If he thinks theft is the issue then he has many other things to learn before dealing with time stamps in code he does not grasp.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
maya Offline referral

Posts: 1,058
Joined: May 2013
Reputation: 34

#8
Posting Freak
Next time share your PHP code for better support because I don't really wanna see you creating many threads on this subject!!!





User(s) browsing this thread: 1 Guest(s)