 |
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
|
|
|

December 30th, 2005, 09:39 AM
|
Registered User
|
|
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 9th, 2006, 12:03 AM
|
Registered User
|
|
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 9th, 2006, 01:55 AM
|
Registered User
|
|
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 9th, 2006, 04:48 AM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 9th, 2006, 11:39 AM
|
Friend of Wrox
|
|
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

January 13th, 2006, 04:51 AM
|
Registered User
|
|
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 13th, 2006, 04:52 AM
|
Registered User
|
|
Join Date: Dec 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

January 15th, 2006, 01:08 PM
|
Friend of Wrox
|
|
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry mate but thats around 2 weeks of work.
|
|
 |