我想在我的网站上快速搜索。如果输入了一个值并与我的首选关键字匹配,它会将您重定向到该页面。
到目前为止,这是我得到的:
<form method="get" action="redirect.php" >
<input id="search" name="search" type="text" value="Search Here" />
<input name="submit" type="submit" value="Go" />
</form>
<?php
if(isset($_GET['submit']));
$product1_keywords = array('animal feeds', 'weanrite', 'Wean Rite');
// my preffered keywords
$search = $_GET['search'];
// caller of entered value on text field ???
if ($search = $product1_keywords) {
// if value of text field is matched with my preferred keywords
// Redirect page if match
header('Location: http://localhost/equalivet_2/#products/wean_rite.html');
}
else {
// Redirect page if not match
header('Location: http://localhost/equalivet_2/not_found.html');
}
?>
请帮帮我。谢谢你。