我想提出一個錨點列表,將提交一個點擊並重定向到另一個頁面的值。形式是:使用錨點列表提交表單並重定向
<form id="searchCategory" action="test.php" method="post">
<div id="categories">
<details>
<summary>Beers</summary>
<a href="test.php" onclick="document.getElementById("title").submit();"> <input id="title" name="title">Lager </input></a>
<a href="#"> Ale</a> //would make as above
<a href="#">Pale Lager </a> // same
</details>
</form>
的test.php的的頂部是這樣的:
<?php
if (!empty($_POST['submit'])){
include ("connection.php");
$title = (trim($_POST['title'])=="")?
die ("You did not enter any search criteria"):
mysql_real_escape_string($_POST['title']);
錨重定向我的test.php的頁面,但價值似乎並沒有提交。
你有引用的問題! – adeneo 2013-03-24 12:59:13