我是Php世界的新手。 這是我的第一個任何形式的問題。 請告訴我我的頁面有什麼錯誤。 當我提交表單時,沒有結果出來。 請給我任何解決方案。我無法在php中解析基本代碼表格
我嘗試按照this視頻。
<!Doctype html>
<html>
<head>
<title> My page </title>``
</head>
<body>
<p style="font-weight:bold">hello1 world</p>
<?php
// Restaruant open at 8
// Restaruant from 8-11
// Lunch from 11-4
// closes at 4
$launch_menu = "Nashta <br />
halwa <br /> gosher <br /> ";
$breakfast_menu = "Launch <br />
sugar <br /> meat <br /> ";
if(isset($_post['time'])) {
$time = $_post['time'];
if($time < 8 or $time >= 16) {
echo "sorry, we are closed <br />" ;
}
else{
echo "Hi, what would you like order <br /> ";
if($time < 11){
echo $breakfast_menu;
}
else if ($time < 16)
{
echo $launch_menu;
}
}
}
?>
<form action='index.php' method='post'>
What time is it? <input type='text' name='time' /> <br />
<input type='submit' value='Submit'>
</form>
</body>
</html>
請注意,標題後面的頭部有兩個奇怪的'\'''字符。由於HTML被解析的方式,這意味着頭部在那裏結束,並且'\'''字符最終在主體中。 –