Jump to content

Website help needed...


avid_merrion

Recommended Posts

I'm currently building a website which will eventually have well above 1000 pages to it. I want to add a search function on one of the pages that will search the name of every page on the website untill it finds what has being entered.

 

I.e I want to search for "sheffield" and the page im lookikng for is called sheffield.php can anyone help?

 

Something nice and simple if possible. :thumbsup:

Link to comment
Share on other sites

Assuming you're using PHP, there are a couple of approaches to take.

 

One would be to generate the pages dynamically - the serach is then done on a database for the title of the page,, or part of the title, and then PHP is used to generate the content of the page from the database record.

 

The next is to have the pages pre-written, then have a database record of the title and the URL. The search function then just finds the title and jumps to teh corresponding URL.

 

Finally, you could use the file handling abilities of PHP to do a regexp search on the file contents of the pages.

 

Each has it's advantages and disadvantages.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.