Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a some html and javascript knowledge and Im trying to learn php. I have made a search engine in javascript and I am trying to make a php version of it. I am trying to make two versions of it. A google version and just an advanced serach engine.
This is my search script:
[syntax="html"]
<script language='JavaScript'>
<!--
function startSearch(){
searchString = document.searchForm.searchText.value;
if(searchString != ''){
searchEngine = document.searchForm.whichEngine.selectedIndex + 1;
finalSearchString = '';
if(searchEngine == 1){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=' + searchString;
}
if(searchEngine == 2){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=' + searchString;
}
if(searchEngine == 3){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=+' + searchString;
}
if(searchEngine == 4){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=' + searchString;
}
if(searchEngine == 5){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=' + searchString;
}
if(searchEngine == 6){
finalSearchString = 'http://www.google.com/search?hl=en&q=+' + searchString;
}
if(searchEngine == 7){
finalSearchString = 'http://www.google.com/search?hl=en&lr=&safe=off&q=' + searchString;
}
location.href = finalSearchString;
}
}
// -->
</script>
<basefont face='Verdana, Arial, sans-serif'>
<form name='searchForm'>
Warez Search:<br>
<input style='background: dddddd' name='searchText' type='text'>
<br>
<select style='background: dddddd' name='whichEngine'>
<option selected>-
<option>-
<option>-
<option>-
<option>-
<option>-
<option>-
</select>
<input type='button' value='Search' onClick='startSearch()'>
</select>
</form>
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]