stvchez Posted February 1, 2007 Share Posted February 1, 2007 this should be an easy one, but it's got me stumped... I'm trying to populate a calendar, and almost there, but my if statement keeps erroring out. $eventdate = $_GET['date']; echo"$eventdate"; // value is 01-18-2007 echo"$m-$d-$y"; // value is 01-18-2007 if ($eventdate == $m-$d-$y) ( echo"test"; } thanks in advance! Link to comment https://forums.phpfreaks.com/topic/36567-solved-if-stmt-question/ Share on other sites More sharing options...
HuggieBear Posted February 1, 2007 Share Posted February 1, 2007 It thinks $m-$d-$y is $m (minus) $d (minus) $y Try this: <?php $eventdate = $_GET['date']; echo "$eventdate"; // value is 01-18-2007 echo "$m-$d-$y"; // value is 01-18-2007 if ($eventdate == "$m-$d-$y"){ echo"test"; } ?> Regards Huggie Link to comment https://forums.phpfreaks.com/topic/36567-solved-if-stmt-question/#findComment-174140 Share on other sites More sharing options...
stvchez Posted February 1, 2007 Author Share Posted February 1, 2007 many thanks, that was it Link to comment https://forums.phpfreaks.com/topic/36567-solved-if-stmt-question/#findComment-174143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.