code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
if(isset($_POST["gio"]))
{
$gio=$_POST["gio"];
if($gio>=0 && $gio<=12)
{
echo $chao="chao buoi sang";
}
if($gio>=13 && $gio<=18)
{
echo $chao="chao buoi chieu";
}
if($gio>=19 && $gio<=24)
{
echo $chao="chao buoi toi";
}
}
?>
<form id="form1" name="form1" method="post" action="">
<table width="639" height="234" border="1" backgroundcolor="blue">
<tr>
<td colspan="2" align="center" bgcolor="#0066CC">Gio</td>
</tr>
<tr>
<td width="278">nhap gio</td>
<td width="345"><label for="gio"></label>
<input type="text" name="gio" id="gio" value="<?php if(isset($_POST["gio"])) echo $gio; ?>"/></td>
</tr>
<tr>
<td colspan="2"><?php if(isset($_POST["gio"])) echo $chao; ?></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" name="tinh" id="tinh" value="chao" /></td>
</tr>
</table>
</form>
</body>
</html>
0 comments:
Post a Comment