Need help understanding code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gern
Forum Newbie
Posts: 1
Joined: Fri Feb 26, 2010 5:11 pm

Need help understanding code

Post 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
}
?>
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Need help understanding code

Post 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?
Post Reply