Jump to content

[SOLVED] 'if' stmt question


stvchez

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.