Results 1 to 5 of 5

Thread: Custom Keyword Redirect

  1. #1
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Custom Keyword Redirect

    I am trying to add a box to my web page that the user can type in a KEYWORD and be directed to one of my pages based on the keyword. Example if they enter "tom" they will be dierected to www.tomboy.com or if they enter "apple" they are directed to www.apples.com. I downloaded a script a while back from the page but can not find it now. The script had a section where you typed out the keyword and where to redirect. Example
    if keyword = "Tom" then goto "www.tomboy.com
    if keyword = "apple then goto "www.apples.com
    Etc.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Sep 2006
    Location
    England
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking

    Hi deparkfire,
    Here you go. I've made it case sensitive. Just add as many keywords as your heart desires!!

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    	
    <script type="text/JavaScript">
    <!--
    function Login(){
    var done=0;
    var keyword=document.enter_keyword.keyword.value;
    //keyword=keyword.toLowerCase();
    if (keyword=="Tom") { window.location="http://www.tomboy.com"; done=1; }
    if (keyword=="apple") { window.location="http://www.apples.com"; done=1; }
    if (keyword=="orange") { window.location="http://www.oranges.com"; done=1; }
    if (done==0) { alert("WARNING:Incorrect keyword you plonker!!!"); }
    }
    //-->
    </script> 	
    
    </head>
    
    <body>
    
    <form name=enter_keyword>
        <table border="1" cellpadding="2" cellspacing="2" bgcolor="#7B97E0">
    	    <tr>
    			<td>
    			<font color="#ffffff"><b>Enter keyword:</b></font>
    			</td>
    			<td><input type=text name=keyword>
    			</td>
    		</tr>
    		<tr>
    			<td colspan=2 align=center>
    			<input type=button value="Login!" onClick="Login()">
    			</td>
    		</tr>
    	</table>
    </form>
    
    </body>
    </html>
    Hope this helps.
    Regards,
    Ges.

  3. #3
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thank You

    THANK YOU THANK YOU THANK YOU
    This is exaclty what I was looking for.

  4. #4
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hi i tried the script on Custom Keyword Redirect below and i cant get it to work in internet explorer it works only in firefox,,can you help me ??

    james

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>

    <script type="text/JavaScript">
    <!--
    function Login(){
    var done=0;
    var keyword=document.enter_keyword.keyword.value;
    //keyword=keyword.toLowerCase();
    if (keyword=="Tom") { window.location="http://www.tomboy.com"; done=1; }
    if (keyword=="apple") { window.location="http://www.apples.com"; done=1; }
    if (keyword=="orange") { window.location="http://www.oranges.com"; done=1; }
    if (done==0) { alert("WARNING:Incorrect keyword you plonker!!!"); }
    }
    //-->
    </script>

    </head>

    <body>

    <form name=enter_keyword>
    <table border="1" cellpadding="2" cellspacing="2" bgcolor="#7B97E0">
    <tr>
    <td>
    <font color="#ffffff"><b>Enter keyword:</b></font>
    </td>
    <td><input type=text name=keyword>
    </td>
    </tr>
    <tr>
    <td colspan=2 align=center>
    <input type=button value="Login!" onClick="Login()">
    </td>
    </tr>
    </table>
    </form>

    </body>
    </html>

  5. #5
    Join Date
    Sep 2006
    Location
    England
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    WHEN WILL CRAPPY ADVERTISERS LEARN HOW TO MARKET IN A PROFESSIONAL WAY?

    MODERATOR - COULD YOU REMOVE THE POST FROM jgold501 AS ANYONE CAN SEE THAT THE SCRIPT WORKS ON ALL BROWSERS JUST BY LOOKING AT IT.

    MEMBERS - DON'T EVEN TRY HIS CODE AS IT WILL PROBABLY LEAD YOU TO SOME ADWARE ETC.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •