...

View Full Version : Different Script, Different Problem



dniwebdesign
09-22-2004, 08:42 PM
$t=date("j");
$m=date("F");

if($m=="January" && $t="31")
{ $thismonth="February"; $thisday="1"; }
else if($m=="February" && $t="28")
{ $thismonth="March"; $thisday="1"; }
else if($m=="March" && $t="31")
{ $thismonth="April"; $thisday="1"; }
else if($m=="April" && $t="30")
{ $thismonth="May"; $thisday="1"; }
else if($m=="May" && $t="31")
{ $thismonth="June"; $thisday="1"; }
else if($m=="June" && $t="30")
{ $thismonth="July"; $thisday="1"; }
else if($m=="July" && $t="31")
{ $thismonth="August"; $thisday="1"; }
else if($m=="August" && $t="31")
{ $thismonth="September"; $thisday="1"; }
else if($m=="September" && $t="30")
{ $thismonth="October"; $thisday="1"; }
else if($m=="October" && $t="31")
{ $thismonth="November"; $thisday="1"; }
else if($m=="November" && $t="30")
{ $thismonth="December"; $thisday="1"; }
else if($m=="December" && $t="31")
{ $thismonth="January"; $thisday="1"; }
else
{ $thismonth=$m; $today=$t+1; }


at the moment $m=September and &t=22 (today's date)... I am having problems as it keeps setting $thismonth and $today as October 1. I thought the "&&" meant both variables had to be true, not just 1.

bcarl314
09-22-2004, 09:32 PM
It does, but you have

$t="1"

which is always true. It should be
$t=="1"

dniwebdesign
09-22-2004, 09:35 PM
Ah... okay... i'll give that a shot later...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum