1.Ive created a simple way to redirect users from my homepage to another page based on their selection from an auto generate input box. But there seems to be a problem with my php code as it keeps redirecting me only to the first link
2.the code for the input box on my homepage is
html
body
<form action="item-search.php">
<input class="awesomplete" name="items" onchange="this.form.submit()" list = "mylist" placeholder = "Search Items..."/>
<datalist id = "mylist" name="items">
<option value="Item1">Item1</option>
<option value="Item2">Item2</option>
<option value="Item3">Item3</option>
</datalist>
<noscript>
<input type="submit" name="items">
<noscript/>
</form>
body
html
3.then on the item-search.php page
<?php
$items = $_POST['items'];<br>
if ($items = 'Item1') {<br>
header("Location: item1.php");<br>
}<br>
elseif ($items = 'Item2') {<br>
header("Location: item2.php"); <br>
}<br>
elseif ($items = 'Item3') {<br>
header("Location: item3.php"); <br>
}<br>
?>
4.but no matter what i select it redirects to item1.php
` from each ling of your code. I don't think it is even syntactically correct. – Maximus2012 Mar 03 '16 at 15:24
for display here, i didnt use
on every line of code in my actual work. – Dahlia Mar 03 '16 at 15:32