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="Berk" data-source="post: 417554" data-attributes="member: 63611"><p>Yeah I was not asking for javascript code xD </p><p></p><p>So I've edited code abit and, </p><p>now the code is like this : </p><p>[php] </p><p></p><p>$where_post = $_POST['find_where']; </p><p>$text = $_POST['text']; </p><p></p><p>if($where_post == 'Anywhere') {</p><p> $where = 'folders/'; </p><p>}</p><p>elseif ($where_post == 'CMS') {</p><p> $where = 'folders/CMS/';</p><p>}</p><p>elseif ($where_post == 'Emulator') {</p><p> $where = 'folders/Emulator/';</p><p>}</p><p>elseif ($where_post == 'Full Packs') {</p><p> $where = 'folders/Full Packs/';</p><p>}</p><p>elseif ($where_post == 'Furni Packs') {</p><p> $where = 'folders/Furni Packs/';</p><p>}</p><p>elseif ($where_post == 'SQL') {</p><p> $where = 'folders/SQL/';</p><p>}</p><p>elseif ($where_post == 'SWF') {</p><p> $where = 'folders/SWF/';</p><p>}</p><p>$files = glob("../".$where."/*". $text ."*.*");</p><p></p><p>if(count($files[0]) > 0){</p><p> foreach($files as $file){</p><p> $info = pathinfo($file);</p><p> $name = basename($files);</p><p></p><p> ?> </p><p><div style="width:400px; padding:20px; border-bottom:1px solid white;"></p><p> <div style="width:100px;height:100px; border:1px solid white; background:<?= $color; ?>" name="icon"></p><p> <div class='tile-icon'></p><p> <span class='icon mif-folder mif-4x' style="padding:20px;"></span></p><p> </div></p><p></div></p><p> <div style="float: right; cursor: auto; z-index: auto; position: relative; top: -100px; left: -133px;"><h3>CMS 1.zip</h3></div></p><p> <div style="float: right; cursor: auto; z-index: auto; position: relative; top: -1px; left: 75px;">size</div></p><p> <div id="text"></p><p> click 2 downl04d</p><p> </div></p><p></div></p><p> <?php </p><p> }</p><p>}</p><p>else { </p><p> die('No files found.');</p><p>}</p><p> ?></p><p></p><p>[/php] and it returns 'no files found' but there is files like that name so..</p></blockquote><p></p>
[QUOTE="Berk, post: 417554, member: 63611"] Yeah I was not asking for javascript code xD So I've edited code abit and, now the code is like this : [php] $where_post = $_POST['find_where']; $text = $_POST['text']; if($where_post == 'Anywhere') { $where = 'folders/'; } elseif ($where_post == 'CMS') { $where = 'folders/CMS/'; } elseif ($where_post == 'Emulator') { $where = 'folders/Emulator/'; } elseif ($where_post == 'Full Packs') { $where = 'folders/Full Packs/'; } elseif ($where_post == 'Furni Packs') { $where = 'folders/Furni Packs/'; } elseif ($where_post == 'SQL') { $where = 'folders/SQL/'; } elseif ($where_post == 'SWF') { $where = 'folders/SWF/'; } $files = glob("../".$where."/*". $text ."*.*"); if(count($files[0]) > 0){ foreach($files as $file){ $info = pathinfo($file); $name = basename($files); ?> <div style="width:400px; padding:20px; border-bottom:1px solid white;"> <div style="width:100px;height:100px; border:1px solid white; background:<?= $color; ?>" name="icon"> <div class='tile-icon'> <span class='icon mif-folder mif-4x' style="padding:20px;"></span> </div> </div> <div style="float: right; cursor: auto; z-index: auto; position: relative; top: -100px; left: -133px;"><h3>CMS 1.zip</h3></div> <div style="float: right; cursor: auto; z-index: auto; position: relative; top: -1px; left: 75px;">size</div> <div id="text"> click 2 downl04d </div> </div> <?php } } else { die('No files found.'); } ?> [/php] and it returns 'no files found' but there is files like that name so.. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
PHP - Search Through Files
Top