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 February 23rd, 2005, 01:18 PM
nav nav is offline
Registered User
 
Join Date: Aug 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Read and Display Strings

Hi, Does any one know how i can let a user search a text file and display the details they have selected.

For example i have a log file with a list of users details about when they accessed my web site. All i want them to do is enter some search data into a form (say username) and from there it will search through the log file (which is a simple text file) and display relevant data associated with their username.

Any ideas would be great.

 
Old March 27th, 2005, 09:44 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I'd start here with that project:
http://www.php.net/manual/en/ref.filesystem.php

Several of those functions are very useful. For instance the fgetcsv() function can be used to parse comma delimited data one line at a time. Of course it all depends on how this text file is structured as to which functions will be the best for the job.

Of course it goes without saying really, that could be a resource-intensive program (depending on the size of these files) and you might be better off considering parsing that log data into a proper database, which is built for queries and such things.



Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to display Filter Strings in Report Header Jabba007 Access VBA 7 July 17th, 2007 12:07 PM
HOW-TO: Read and Display RSS Feeds dparsons ASP.NET 1.0 and 1.1 Professional 0 January 11th, 2007 04:30 PM
read field description and display on webpage wpiass Access ASP 7 October 5th, 2005 06:41 AM
display strings filaman70 Javascript How-To 2 November 5th, 2004 09:00 AM





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