php search of site
Moderator: General Moderators
-
panamaszr12
- Forum Newbie
- Posts: 1
- Joined: Fri Oct 10, 2003 8:57 am
php search of site
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.
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
- 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
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.
-
Cruzado_Mainfrm
- Forum Contributor
- Posts: 346
- Joined: Sun Jun 15, 2003 11:22 pm
- Location: Miami, FL
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
and then search in every record for the words
etc etc
Code: Select all
page |words
----------------------------------------------
m.php |go click wait mine jump squeeze
r.php |something bad good wrongetc etc