Page 1 of 1

Need help understanding code

Posted: Fri Feb 26, 2010 5:17 pm
by gern
I am new to php but I have lots of VB.NET experience. The block of php code below is resulting in
"$today) { ?> Registration......" without the quotes. Why is the comparison operator '>' being treated like '?> ' ??

<?php

$beg_date = "2010-03-01";
$exp_date = "2010-04-16";
$todays_date = date("Y-m-d");

$today = strtotime($todays_date);
$beginning_date = strtotime($beg_date);
$expiration_date = strtotime($exp_date);

if ($beginning_date > $today){
?>
Registration has not opened.<br>Please come back and register between March 1st and April 16th.<br>
<?php
}
?>

Re: Need help understanding code

Posted: Fri Feb 26, 2010 5:35 pm
by Darhazer
It's not being parsed at all, it's treated as HTML page.
If you choose view source from your browser, it will display the entire source
the comparison operator in the case is the closing of the tag
Check your server settings, it seems that you have no appropriate handler for .php files... or do you have web server at all?