Mình đang tự học PHP. Nhưng mới vào là mắc lỗi mong các bạn giúp đỡ. Đùng chủi mình Ngu Nha.
mình làm 1 trang tinh diện tích hình cưữ nhật như sau mà nó không chạy.
báo lỗi ngay code "<?php echo $_POST["chieudai"]; ?>", <?php echo $_POST["chieudai"]; ?>
(chieudai, chieurong undeifined)<!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>dien tich hinh chu nhat</title>
</head>
<body>
<?php
$chieudai=$_POST["chieudai"];
$chieurong=$_POST["chieurong"];
$dt= $chieudai* $chieurong;
?>
<form id="form1" name="form1" method="post" action="DientichHCN.php">
<table width="400" border="1" align="center">
<tr>
<td colspan="2">DIEN TICH HINH CHU NHAT</td>
</tr>
<tr>
<td width="73">Chieu dai</td>
<td width="111"><label for="chieudai"></label>
<input name="chieudai" type="text" id="chieudai" value="<?php echo $_POST["chieudai"]; ?>" /></td>
</tr>
<tr>
<td>Chieu rong</td>
<td><label for="chieurong"></label>
<input name="chieurong" type="text" id="chieurong" value="<?php echo $_POST["chieurong"]; ?>" /></td>
</tr>
<tr>
<td>Dien tich</td>
<td><label for="dt"></label>
<input name="dt" type="text" id="dt" value="<?php echo "$dt";?> " /></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" id="button" value="Tinh" />
</div></td>
</tr>
</table>
</form>
</body>
</html>
Các bạn giúp mình sớm nha. Cam ơn