note 83946 rejected from function.date by felipe
| From: | felipe@php.net | Date: | Thu, 19 Jun 2008 21:39:12 +0000 |
| Subject: | note 83946 rejected from function.date by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140603@lists.php.net to get a copy of this message | ||
Note Submitter: jayweb321 at gmail dot com
----
Hi, I am so freaking new to PHP... I want to create a code in which I state the date. And based on
that date I can show a CODEWORD, or image on future dates.
So, let's say the date is 06-19-2008,
now...
if its +1 day it will echo this
if its +2 days it will echo this
if its +3 days it will echo this...... and so on.
This is what I came up with, but can't seem to make it work...
$startdate = '06/19/2007';
if ($newdate == date('m/d/Y', strtotime("+1 days", strtotime($startdate)))) echo
"first<br>";
if ($newdate == date('m/d/Y', strtotime("+2 days", strtotime($startdate)))) echo
"second<br>";
if ($newdate == date('m/d/Y', strtotime("+3 days", strtotime($startdate)))) echo
"third<br>";
it doesn't work... it just writes all the dates... -=( I need this to show one code per day
from a starting date.
Thanks
P.S.
in the past, I did this: but it sux because I have to change the dates all the time I need a new
one.
$today = date("m-d-Y");
if ($today == date("05-16-2008")) { $video1 = 343KOSLL31';}
if ($today == date("05-17-2008")) { $video1 = '5MK78hZL3o0';}
if ($today == date("05-18-2008")) { $video1 = '5xNZ5CC0gvk';}
if ($today == date("05-19-2008")) { $video1 = '3q2vZDQU8aA';}
if ($today == date("05-20-2008")) { $video1 = 'BfWIP02g41g';}
if ($today == date("05-21-2008")) { $video1 = 'lawXkvPFRgI';}
HEEEEEEEEEEEELP... anyone???