Page 1 of 1
php search of site
Posted: Fri Oct 10, 2003 8:57 am
by panamaszr12
I am new to php and have seen a person can use it to do a site search. My problem is I have never built anything like this so I could use a tutorial or some advice. I need to an automatic index, and a simple search. My site is on a windows 2000 server and has asp pages in it, but I have setup the pages in html format.
Posted: Fri Oct 10, 2003 9:07 am
by wmasterj
the way you search the sites, the ones i know atleast:
- having the information in a database and search that
- open every html file and search the information within the html page, although that's quite a thing to create, specially if your new to php
otherwise here's a tutorial:
http://www.zend.com/zend/tut/tutorial-Ferrara.php - for searching MySQL database with PHP.
http://se.php.net/manual/en/function.file.php - for searching *.html files
Posted: Fri Oct 10, 2003 2:35 pm
by murph
Well it depends if you want the user to search for something specific or just some text on a page. You can make a database that the user can search through. or if you want the user to be able to search a html document just load that file up in an array and search through the array for the search text. if the search text is found then output a link to that html document.
Posted: Fri Oct 10, 2003 3:02 pm
by Cruzado_Mainfrm
searching thru every page is odd and slow, u have to make a 'page reader', read all the pages and add the words in a database and refer them to the page it corresponds... like
Code: Select all
page |words
----------------------------------------------
m.php |go click wait mine jump squeeze
r.php |something bad good wrong
and then search in every record for the words
etc etc