-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.php
24 lines (24 loc) · 857 Bytes
/
search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
<head>
<title>Google Search</title>
<script>
function submitSearchForm(button) {
var googleSearchForm = document.getElementById("google-search-form");
if (button.id == 'google-web-search-button') {
googleSearchForm.action = 'http://www.google.com/search';
} else if (button.id == 'google-image-search-button') {
googleSearchForm.action = 'http://images.google.com/images';
}
googleSearchForm.method = 'get';
googleSearchForm.submit();
}
</script>
</head>
<body>
<form id="google-search-form">
<input type="text" name="q" />
<input id="google-web-search-button" type="button" value="Web Search" onclick="submitSearchForm(this)" />
<input id="google-image-search-button" type="button" value="Image Search" onclick="submitSearchForm(this)" />
</form>
</body>
</html>