-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.php
More file actions
19 lines (18 loc) · 744 Bytes
/
Copy pathsearch.php
File metadata and controls
19 lines (18 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
$name = $_POST["search"];
//echo $name;
$fruits = array("mangoes","mango","apples","Watermellon","apple","banana","bananas","citrus","orange","oranges","grapes","berries"); // You can set multiple check conditions here
$vegetables = array("capsicum","beans","ladysfinger","redchilli","beans","carrot","cauliflower","garlic","potato","pumpkin"); // You can set multiple check conditions here
if (in_array($name, $fruits)) //Founds a match !
{
header("Location:fruitspage.php");
}
else if (in_array($name, $vegetables)) //Founds a match !
{
header("Location:vegetablespage.php");
}
else{
$page=$_SERVER['HTTP_REFERER'];
header("Location:$page");
}
?>