Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Working on building my own search - Help needed!
Old 06-03-2009, 06:58 PM Working on building my own search - Help needed!
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
I am working on making my own search that is very small, and uses only 1 page (no outside scripts). I don' tactually have to code for it, yet, but this is what is going to happen.

1. You type in a keyword into a text box. Let's say you type in 'guitar'

2. The text box's JavaScript looks up anything with the name 'guitar' in the page's content/title.

3. It displays the search results (using 'document.writeIn'). All pages with the word 'guitar' will show up like this ((in order from most relevant (in the title, for example) to least)):
Code:
Guitar TablatureTablature - Here you can find guitar tablature for some songs!
http://www.execulink.com/~kayes/physicsguy/web/tablature.shtml

Music
Here at the music section, you can find all the other music stuff!  
http://www.execulink.com/~kayes/physicsguy/web/music.shtml

Home
Welcome to PGReviews!  Here, we have guitar tablature, animations...
4. You can click any link to go to that page, and voila! Yu got yerself uh surch funkshun!

So far, here's the outline of what I have:

Code:
[nothing]
It's amazing. I don't know.

Who can help? THANKS if so!!!

Here's some technical stuff how it would work:


Code:
<script id="searchlookup" type="text/javascript">
var searchLookUp=new Array(3);
searchLookUp[0]="Page 1, it's keywords, description, blah blah blah";
searchLookUp[1]="Page 2, it's keywords, description, blah blah blah";
searchLookUp[2]="Page 3, it's keywords, description, blah blah blah";

</script>

<script type="text/javascript">

function welcome()

  {
  document.writeIn(" + document.forms["searchform"]["searchlookup"].value + ".htm*");                                                                                                                  
  }

</script>

<script type="text/javascript">

if (search < 0) 
{
document.write("No search results found.  Try using a different keyword.");
}
else
{
document.write(" (search results) ");
}
</script>


<form name="searchformform" action="search.htm" onsubmit="welcome()" id="searchform">

<p>Search PGReviews!</p>
<input type="text" name="searchlookup" size="20" />
<input type="button" value="Search" onclick="welcome()" />

</form>
Or instead, this function:
Code:
<script type="text/javascript">

function welcome()

  {
  document.write(searchLookUp[0]);                                                                                                                  
  }

</script>
(Except that the [0] would access to a keyword, with ANOTHER array!)

Now I KNOW that won't work. 'goto' isn't valid. But that's the idea.

searchlookup refers to a JavaScript file that looks at an array of all the pages, keywords, titles, and addresses.

Here's something that works, but it's sort of useless.
Code:
<script type="text/javascript">
var searchLookUp=new Array();
searchLookUp[0]="[Goes to Page 1]";
searchLookUp[1]="Page 2";
searchLookUp[2]="Page 3";
</script>

<script type="text/javascript">

function welcome()

  {
  document.write(searchLookUp[0]);                                                                                                                  
  }

</script>

<input type="text" name="searchlookup" size="20" />
<input type="button" value="Search" onclick="welcome()" />
If you type '0' (without the quotes) into the text box, it displays Page 1. Getting there. You need to know the number of the age to get there, though.

I just don't get what's going on here, though. There is no [3], yet is displays it!

Code:
<script type="text/javascript">


<script type="text/javascript">
var searchLookUp=new Array(3);
searchLookUp[0]="[Goes to Page 1]";
searchLookUp[1]="Page 2";
searchLookUp[2]="Page 3";
</script>

<script type="text/javascript">

function welcome()

  {
  document.write("searchLookUp[" + document.forms["searchform"]["searchlookup"].value + "]");                                                                                                                  
  }

</script>
<form name="searchform" onsubmit="welcome()" id="searchform">
<input type="text" name="searchlookup" size="20" />
<input type="button" value="Search" onclick="welcome()" />
</form>
I can completely remove the
searchLookUp[0]="[Goes to Page 1]";
searchLookUp[1]="Page 2";
searchLookUp[2]="Page 3";
and it still works! I don't get it! It just writes the name of the 'var', then the array number!

Actually, the whole array isn't used AT ALL! The 'searchLookUp' comes from the part after 'document.write'!! You could change it to 'hello world!' and it would say 'hello world!' with what you typed in!

AAAAAAHHHH!!!

What I need to do is make it:

If document = searchLookUp[0], document.write("Welcome to Page 1!");
If document = searchLookUp[2], document.write("Welcome to Page 2!");

and so on...

I need a database of all these. I could do it, but that wouldn't make it display a 'results' page, nor any working links, OR any actual content, or pages, or listings.........

I'm in so much confusion! AUGH!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!

Last edited by Physicsguy; 06-03-2009 at 08:26 PM..
Physicsguy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-04-2009, 02:06 AM Re: Working on building my own search - Help needed!
Experienced Talker

Posts: 30
Name: Kulrom
Location: Republic of Macedonia
Trades: 0
You need some server-side code/script for this.
Is it Windows or Linux based server? If later then i suggest PHP and if it's Windows i strongly recommend ASP.NET.
However the code will parse all pages/forms and return the results if any.
Javascript is not what you need definitely.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Kulrom is offline
Reply With Quote
View Public Profile Visit Kulrom's homepage!
 
Old 06-04-2009, 08:22 AM Re: Working on building my own search - Help needed!
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
javascript is all I have! I use apache Linux, sorry for mytuoing it's from amniood touch

Is there a way it is posible? Yes! I need to build my own though, because that one costs $$ just google "search machine javascript" and the first one.

Tahnks
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!

Last edited by Physicsguy; 06-04-2009 at 08:26 AM..
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 06-04-2009, 01:13 PM Re: Working on building my own search - Help needed!
Experienced Talker

Posts: 30
Name: Kulrom
Location: Republic of Macedonia
Trades: 0
Well if i remember well you said "no outside scripts" but that one is exactly that
http://javascript.internet.com/gener...h-machine.html

Otherwise i am not sure what is your question here?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Kulrom is offline
Reply With Quote
View Public Profile Visit Kulrom's homepage!
 
Old 06-04-2009, 04:36 PM Re: Working on building my own search - Help needed!
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Alright... Whatever!

I don't care if it's inside or outside! All I want is the script

Anyone know of a good one?
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 06-04-2009, 07:11 PM Re: Working on building my own search - Help needed!
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
That's okay kulrom, I have your pos in my emailbrcause I subscribed to this thread. I'll try it, but I don't have amy promises
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 06-07-2009, 08:44 AM Re: Working on building my own search - Help needed!
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Okay,

After working on some things, this is what I have. It doesn't work, but that's the idea of what should happen (not the 'not working' part)

Code:
<script type="text/javascript">
var searchLookUp=new Array();
searchLookUp[0]="[Goes to Page 1]";
searchLookUp[1]="Page 2";
searchLookUp[2]="Page 3";
</script>

<script type="text/javascript">

function welcome()

  {
document.write(searchLookUp[0]);                                                                                                                  
  }

</script>

<h3>Use this field to type <i>anything,</i> and it returns '[Goes to Page 1]'.</h3>
<input type="text" name="searchLookUp" size="20" /><input type="button" value="Search" onclick="welcome()" />
<br />
<h3>Use this field to use the 'slubox'.</h3>
<input type="text" name="slubox" size="20" />
<input type="button" value="Search" onclick="document.getElementById()" />


<script type="text/javascript">
var slubox=new Array();
var slu = slubox.getElementById();

if (slubox = 0)
  {
  document.write(searchLookUp[0]);
  }
else if (slubox = 1)
  {
  document.write(searchLookUp[1]);
  }
else
  {
  document.write("Please only type in either '1' or '0'.");
  }
</script>
I am under a sheet with this! I'm very confused!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Working on building my own search - Help needed!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28333 seconds with 12 queries