avid_merrion Posted September 23, 2006 Share Posted September 23, 2006 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. Link to comment Share on other sites More sharing options...
JoeP Posted September 23, 2006 Share Posted September 23, 2006 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.