-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgethint.php
More file actions
112 lines (106 loc) · 1.98 KB
/
gethint.php
File metadata and controls
112 lines (106 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
$a[] = 'alienware';
$a[] = 'ball';
$a[] = 'balls';
$a[] = 'bat';
$a[] = 'bats';
$a[] = 'calvin';
$a[] = 'calvinklein';
$a[] = 'cap';
$a[] = 'casual';
$a[] = 'cleaner';
$a[] = 'cloth';
$a[] = 'clothes';
$a[] = 'clothing';
$a[] = 'computer';
$a[] = 'cosco';
$a[] = 'cricket';
$a[] = 'denim';
$a[] = 'drive';
$a[] = 'electronics';
$a[] = 'football';
$a[] = 'footwear';
$a[] = 'formal';
$a[] = 'gforce';
$a[] = 'grinder';
$a[] = 'inalsa';
$a[] = 'jack';
$a[] = 'jackandjone';
$a[] = 'jackandjones';
$a[] = 'jacket';
$a[] = 'jackets';
$a[] = 'jean';
$a[] = 'jeans';
$a[] = 'jones';
$a[] = 'keyboard';
$a[] = 'kingston';
$a[] = 'kitchen';
$a[] = 'klein';
$a[] = 'klien';
$a[] = 'lacoste';
$a[] = 'laptop';
$a[] = 'lawn';
$a[] = 'lawntennis';
$a[] = 'levis';
$a[] = 'lg';
$a[] = 'microsoft';
$a[] = 'microwave';
$a[] = 'mixer';
$a[] = 'mouse';
$a[] = 'mrf';
$a[] = 'nike';
$a[] = 'nivia';
$a[] = 'oven';
$a[] = 'pendrive';
$a[] = 'philips';
$a[] = 'phone';
$a[] = 'puma';
$a[] = 'racquet';
$a[] = 'samsung';
$a[] = 'sandal';
$a[] = 'sandals';
$a[] = 'shirt';
$a[] = 'shirts';
$a[] = 'shoe';
$a[] = 'shoes';
$a[] = 'short';
$a[] = 'shorts';
$a[] = 'sneakers';
$a[] = 'sport';
$a[] = 'sports';
$a[] = 'stud';
$a[] = 'studs';
$a[] = 'sweat';
$a[] = 'sweatshirt';
$a[] = 'tennis';
$a[] = 'timberland';
$a[] = 'titan';
$a[] = 'vacuum';
$a[] = 'vacuumcleaner';
$a[] = 'watch';
$a[] = 'watches';
$a[] = 'wearable';
$a[] = 'wearables';
$a[] = 'wilson';
$a[] = 'woodland';
$a[] = 'appliance';
// get the q parameter from URL
$q = $_REQUEST["q"];
$hint = "";
// lookup all hints from array if $q is different from ""
if ($q !== "") {
$q = strtolower($q);
$len=strlen($q);
foreach($a as $name) {
if (strcmp($q, substr($name, 0, $len)) == 0) {
if ($hint === "") {
$hint = $name;
} else {
$hint .= ", $name";
}
}
}
}
// Output "no suggestion" if no hint was found or output correct values
echo $hint === "" ? "no suggestion" : $hint;
?>