Files
004_comission/_resources/it114105/itp4513/Lab03/Lab03_Task1.php
louiscklaw 6c60a73f30 update,
2025-01-31 19:15:17 +08:00

42 lines
988 B
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lab03 Task1</title>
</head>
<body>
<?php
extract($_POST);
$isVaild = true;
if(!isset($name) || strlen(trim($name)) == 0){
echo "Name field is missing <br />";
$isVaild = false;
}
if(!isset($year) || strlen(trim($year)) == 0){
echo "Graduate Year field is missing <br />";
$isVaild = false;
}
if(!isset($comments) || strlen(trim($comments)) == 0){
echo "Comment field is missing <br />";
$isVaild = false;
}
if($isVaild){
echo "Name: $name<br>";
echo "Graduate Year: $year<br>";
echo "Alumi: $alumi<br>";
echo "Comments: $comments";
}
?>
</body>
</html>