【发布时间】:2011-04-09 06:08:16
【问题描述】:
我在这里有一个 php 代码,我想创建一个“返回”href 让我回到以前的位置。这是我所拥有的:
<input type="submit" <a href="#" onclick="history.back();">"Back"</a>
<html>
<head></head>
<body>
<?php
// get form selection
$day = $_GET['day'];
// check value and select appropriate item
if ($day == 1) {
$special = 'Chicken in oyster sauce';
}
elseif ($day == 2) {
$special = 'French onion soup';
}
elseif ($day == 3) {
$special = 'Pork chops with mashed potatoes and green salad';
}
else {
$special = 'Fish and chips';
}
?>
<h2>Today's special is:</h2>
<?php echo $special; ?>
<input type="submit" <a href="#" onclick="history.back();">"Back"</a>
</body>
</html>
【问题讨论】:
-
你的问题是什么,究竟是什么?
-
可能是 标签内的嵌套 。 (应该是类型按钮,而不是类型提交)。但戴夫已经发布了答案。