I want a quick search on my website. If a value is entered and matched with my preferred keywords, it will redirect you to that page.
So far this is what I got:
<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');
}
?>
Help me please. Thank you.
I think what you’re looking for is
in_arraywhich you would use like this: