Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 30th, 2005, 09:39 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aatayyab Send a message via AIM to aatayyab Send a message via MSN to aatayyab Send a message via Yahoo to aatayyab
Default How do I search TEXT in web folders and pages

hi,

i have a website purely in TEXT format in shape of web pages .HTML and in many sub-folders. i want to search the text in PHP and display the resulting page links which contain that specific search string. how can i do it in PHP?

Best Regards,

Amir Ali Tayyab
IT Consultant since 1988
http://softwarepk.com
aatayyab@yahoo.com
Cell: 92-333-4779799
Address: 49-MZ, Central Plaza, Garden Town, Lahore, Pakistan
 
Old January 9th, 2006, 12:03 AM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pmnghi
Default

Hello
I under your problem
you should use the getfile() (PHP4) to get an entire content of a file ( or a url file ) and save it to a variables
Now, you know what to do next .... ?
if it doesnt work, please reply to me


 
Old January 9th, 2006, 01:55 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aatayyab Send a message via AIM to aatayyab Send a message via MSN to aatayyab Send a message via Yahoo to aatayyab
Default

Sure, it might be easy. however, my problem is that i am very new in PHP and i don't have one page, i have about 1,000 html text pages with lengths more than 50 or so A4 size. so, kindly suggest me some PHP script from start to beging to search the whole text in the site. thanks,

amir


Best Regards,

Amir Ali Tayyab
IT Consultant since 1988
http://softwarepk.com
aatayyab@yahoo.com
Cell: 92-333-4779799
Address: 49-MZ, Central Plaza, Garden Town, Lahore, Pakistan
 
Old January 9th, 2006, 04:48 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Hi,

You could use any of many ready free scripts available from SourceForge or HotScripts. Or you may wait to learn and write the script.



`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances
 
Old January 9th, 2006, 11:39 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

IF you have has many html pages has that doing a search system in php is very unlikely to work.

There is a timeout on the server which is very likely to be hit when the php is still scanning the documents. which mean: this page timeout please press refresh blabla...

Alternatively you could I suppose have a system which scan once all the documents and build a search result file but its still going to be very slow.

I know its not what you had in mind but if you can either transfer all the html documents into a database or only the text part into a database.

Then php send a search request @ the database and that is more or less immediate.
 
Old January 13th, 2006, 04:51 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aatayyab Send a message via AIM to aatayyab Send a message via MSN to aatayyab Send a message via Yahoo to aatayyab
Default

Quote:
quote:Originally posted by anshul
 Hi,

You could use any of many ready free scripts available from SourceForge or HotScripts. Or you may wait to learn and write the script.



`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances
hi,

could you please do that for me and point me towards any of such free scripts out there?

amir


Best Regards,

Amir Ali Tayyab
IT Consultant since 1988
http://softwarepk.com
aatayyab@yahoo.com
Cell: 92-333-4779799
Address: 49-MZ, Central Plaza, Garden Town, Lahore, Pakistan
 
Old January 13th, 2006, 04:52 AM
Registered User
 
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aatayyab Send a message via AIM to aatayyab Send a message via MSN to aatayyab Send a message via Yahoo to aatayyab
Default

Quote:
quote:Originally posted by Mantis
 IF you have has many html pages has that doing a search system in php is very unlikely to work.

There is a timeout on the server which is very likely to be hit when the php is still scanning the documents. which mean: this page timeout please press refresh blabla...

Alternatively you could I suppose have a system which scan once all the documents and build a search result file but its still going to be very slow.

I know its not what you had in mind but if you can either transfer all the html documents into a database or only the text part into a database.

Then php send a search request @ the database and that is more or less immediate.
sure, i am ready to do that and convert them into the text field of the mysql db. can you guide me step-by-step how to do it?

amir


Best Regards,

Amir Ali Tayyab
IT Consultant since 1988
http://softwarepk.com
aatayyab@yahoo.com
Cell: 92-333-4779799
Address: 49-MZ, Central Plaza, Garden Town, Lahore, Pakistan
 
Old January 15th, 2006, 01:08 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry mate but thats around 2 weeks of work.





Similar Threads
Thread Thread Starter Forum Replies Last Post
access ASP pages in different folders misskaos99 Classic ASP Basics 1 May 18th, 2008 06:30 PM
grep-search for text within files, within folders crmpicco Linux 2 September 1st, 2007 10:23 AM
New text search doesn't preselect search string planoie Visual Studio 2005 0 July 23rd, 2007 06:47 AM
Search Engine for Full-text Search Kala ASP.NET 1.0 and 1.1 Professional 2 August 29th, 2004 02:16 AM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.