Click to See Complete Forum and Search --> : Help With Form Script URL Forwarding


dhs
01-30-2003, 09:09 AM
I have a web site on my intranet and it is moderated by a strict guy who doesn't like file sharing. I am running apache so asp, php etc.. are not applicable but I need to use this idea.

There is a "search google" bar on the front page which people can use to (you guessed it!) search google which uses the following html:

<FORM onSubmit="return checksearch()" name="google" method=GET action=http://www.google.com/custom>


<input name="q" TYPE="text" VALUE=" Search Google"size="20" style="FONT-SIZE: 10px; COLOR: black; FONT-FAMILY: verdana, helvetica, arial; BACKGROUND-COLOR: #eeeeee">
<br>
<center><input type="submit" size="20" value="Search" style="color: #000000; background-color: #eeeeee; border-top : 1px solid; border-bottom : 1px solid; border-left : 1px solid; border-right : 1px solid; font-family : Verdana,tahoma,Arial; font-size : 10px; font-weight: bold;">
</center>

<INPUT type=hidden name=cof VALUE="GIMP:#476895;T:black;LW:143;BIMG:#476895;ALC:;GFNT:#476895;LC:black;LH:59;BGC:#ffffff;AH:center;VLC: white;S:http://dhs;GALT:blue;AWFID:ec444c108bfa3093;">

</form>

I want this search tool to keep its function of the search feature but if a user types in "123321" or another combination it forwards them to private page such as "private.htm" so i tried to experiment with a type of validation script but couldn't get how to do it, this is how far i got and i placed this in the <head> tags:
<SCRIPT>
<!--
function checksearch() {
var correct = true
if (document.google.q.value == "123321") {correct = false; load('dhsprivate.htm');}

function load(url)
{
location.href=url;
}

//-->
</SCRIPT>

Could somebody give me the right code i need for this as i know almost no javascript and use notepad for all my work. Also I need to hide this piece of code in the <head> tags so that it cannot be viewed simply by clicking "view source" in Internet Explorer.

Thanks for your help!