•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 392,009 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,248 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2703 | Replies: 5
![]() |
•
•
Join Date: Jun 2007
Location: Albuquerque, NM
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
I have a website that lists pdf files for downloading, with links to each file.
What I want to do now is design a search page that will look in the folder that contains these docs and search for docs that match a partial name.
I have created search pages for MySQL before - do I have to create a table with file names and links and then do a search of MySQL?
TIA,
jej1216
What I want to do now is design a search page that will look in the folder that contains these docs and search for docs that match a partial name.
I have created search pages for MySQL before - do I have to create a table with file names and links and then do a search of MySQL?
TIA,
jej1216
•
•
Join Date: Oct 2006
Location: Sofia, Bulgaria
Posts: 135
Reputation:
Rep Power: 2
Solved Threads: 7
It is possible, however it is said that such functions are subject to vulnerability.
Still - I have made such thing and it is quite self-maintaining page you will get out of it.
See the PHP manual for functions readdir and scandir. It is quite simple to do it.
Still - I have made such thing and it is quite self-maintaining page you will get out of it.
See the PHP manual for functions readdir and scandir. It is quite simple to do it.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
I miss my mind the most...."
Mark Twain
•
•
•
•
I have a website that lists pdf files for downloading, with links to each file.
What I want to do now is design a search page that will look in the folder that contains these docs and search for docs that match a partial name.
I have created search pages for MySQL before - do I have to create a table with file names and links and then do a search of MySQL?
TIA,
jej1216
It is possible to search the directories for files using the PHP file functions like mentioned. See: http://www.php.net/manual/en/function.opendir.php
You'd get better performance by indexing the files in a db like you said, since searching database rows is much faster than scanning a directory, especially if you have many files.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
•
•
Join Date: Jun 2007
Location: Albuquerque, NM
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks for all of the quick replies!
I'll try the opendir and scandir and see if that is quick enough for our purposes. If it's too slow, I'll do the database approach.
Rhyan - you said "It is possible, however it is said that such functions are subject to vulnerability." What vulnerablility? Hacking?
Thanks everyone.
jej1216
I'll try the opendir and scandir and see if that is quick enough for our purposes. If it's too slow, I'll do the database approach.
Rhyan - you said "It is possible, however it is said that such functions are subject to vulnerability." What vulnerablility? Hacking?
Thanks everyone.
jej1216
•
•
Join Date: Apr 2005
Location: Old Hampshire, Old England (LOL)
Posts: 11,937
Reputation:
Rep Power: 30
Solved Threads: 264
they can be exploited to form a DoS attack
servers which have PHP safe mode enabled (most hosted ones) dont allow these potentially dangerous commands
servers which have PHP safe mode enabled (most hosted ones) dont allow these potentially dangerous commands
TRY MY SUGGESTIONS AT YOUR OWN RISK!
james.bennet1@ntlworld.com
james.bennet1@ntlworld.com
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
adsense adult advertising blog blogging bomb book business coding competition copyright daniweb development engine failure forum gentoo google legal malware marketing mcafee microsoft monetization msn new viruses news nhatquanglan operating pagerank php privacy publishing revenue search security seo sex software spam spyware support system technical video virus web webmaster wiki yahoo
- creating an advanced php search (PHP)
- Search string in a text file (C)
- New User (C)
- PHP File Searching (PHP)
Other Threads in the PHP Forum
- Previous Thread: Software Developer Needed - Midi file converter to .lmz
- Next Thread: Php-smarty



Linear Mode