New to PHP. Help please
Posted: Tue Feb 17, 2009 1:31 pm
I'm new to PHP and looking for help, please.
Can anyone tell me why the code below doesn't work? The form is saved as html and the php as weekend.php. I've uploaded to a server but all i get is Have a nice day, whatever is entered into the form.
<form action="weekend.php" method="post">
Date: <input type="text" name="date"><br>
<input type="submit" value="Submit">
</form>
<?php
$d=date("D");
if ($d=="Fri")
echo "Have a nice weekend!";
elseif ($d=="Sun")
echo "Have a nice Sunday!";
else
echo "Have a nice day!";
?>
Thanks!
Can anyone tell me why the code below doesn't work? The form is saved as html and the php as weekend.php. I've uploaded to a server but all i get is Have a nice day, whatever is entered into the form.
<form action="weekend.php" method="post">
Date: <input type="text" name="date"><br>
<input type="submit" value="Submit">
</form>
<?php
$d=date("D");
if ($d=="Fri")
echo "Have a nice weekend!";
elseif ($d=="Sun")
echo "Have a nice Sunday!";
else
echo "Have a nice day!";
?>
Thanks!