[php] checkboxes

Maggie Iaquinto iaquinto at ozemail.com.au
Thu Apr 28 10:21:55 EST 2005


I use Uniserver at home with php 5.0.0 and this script works. On 
openlab, with ver 4.3.3, the if branches do not appear - only the date, 
time and the first $msg.

Any suggestions? Please do not evaluate the text b/c it is just dummied 
up for practice.

Maggie
the html file:
<html><head><title>checkboxes </title></head>
<body>

<form action="checkbox.php" method = POST>
<input type="checkbox" name="chkMeat" value="meat">meat <br>
<input type="checkbox" name="chkVeg" value="vegetables">vegetables <br>
<input type="checkbox" name="chkSweet" value="sweets">ice cream <br>
<input type="checkbox" name="chkBev" value="beverages">OJ <br>

<input type="submit" value = "Hit me">

</form>
</body>
</html>

the php file:
<?php

echo ("The date is: ");

echo date("l, jS F Y");
echo ("<BR>");
echo "The current time is: ";
echo date("H:i.s");
 echo ("<BR><BR><BR><BR><BR><BR>");



$msg= "You have chosen delicious things such as ";
if (!empty($chkMeat))
{
   $msg .= "<ul>$chkMeat <br>";
}
if (!empty($chkVeg))
{
   $msg  .= "<ul>$chkVeg<br>";
}
if (!empty($chkSweet))
{
   $msg  .= "<ul>$chkSweet<br>";
}
if (!empty($chkBev))
{
   $msg  .= "<ul>$chkBev<br>";

}
echo "$msg";

?>





More information about the php mailing list