Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
PHP - Search Through Files
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="JayC" data-source="post: 417534" data-attributes="member: 36373"><p>Well Javascript is a locally ran (on client side) meaning you will not be able to access the files using javascript. So you will have to use a 'POST' search with php to able to locally source the file names, types, etc. securely and safely.</p><p></p><p>Php function glob() would be best for this...</p><p></p><p>Here is a small example:</p><p></p><p>[CODE]$usersSearch = "hello";</p><p></p><p>$files = glob("folders/*$usersSearch*.*");</p><p></p><p>if(count($files) > 0){</p><p> foreach($files as $file){</p><p> $info = pathinfo($file);</p><p> echo "File found";</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="JayC, post: 417534, member: 36373"] Well Javascript is a locally ran (on client side) meaning you will not be able to access the files using javascript. So you will have to use a 'POST' search with php to able to locally source the file names, types, etc. securely and safely. Php function glob() would be best for this... Here is a small example: [CODE]$usersSearch = "hello"; $files = glob("folders/*$usersSearch*.*"); if(count($files) > 0){ foreach($files as $file){ $info = pathinfo($file); echo "File found"; } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP - Search Through Files
Top