By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,536 Members | 2,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,536 IT Pros & Developers. It's quick & easy.

File Search Engine Like Rapidshare Search Script

sagacious
P: 8
Hi There..

Nice Site..

I Want to add a File Search Engine For My Upload And Download Site..

As Like As Rapidshare Search Engins..

I Mean A Search System That Will Search Files From A Folder Of My Server where the files are Uploading by Users..

Any One Have This Kinda Script , I will Greatful to Have it.. <email_removed>
Waiting For Reply..

Thank You.
Oct 12 '09 #1
Share this Question
Share on Google+
10 Replies


P: 3
@sagacious
Me also need help on it.. any one here for help ???
Oct 12 '09 #2

Dormilich
Expert Mod 5K+
P: 8,639
if you have the files in a directory (and not in a DB) you can use glob().
Oct 12 '09 #3

sagacious
P: 8
my db and directory both contain the files but it doesn't works with google custom search though it counts the pages but i need a script for that as like as RapidShare Search Engines..
Oct 12 '09 #4

Dormilich
Expert Mod 5K+
P: 8,639
u s e g l o b ( )

____________________
Oct 12 '09 #5

sagacious
P: 8
hmm.. i tried bt dosen't work.. is there any built in script do you have in your collection ?

i need that for my site

www.get.biobeo.com
Oct 12 '09 #6

Dormilich
Expert Mod 5K+
P: 8,639
@sagacious
nope, never used glob() before.
Oct 12 '09 #7

sagacious
P: 8
so can u guide me to pass through this ? is this possible to modify a rapid share search script to search through my file directory ?
Oct 12 '09 #8

Dormilich
Expert Mod 5K+
P: 8,639
read the comments of the glob() manual entry, what you look for is quite probably described there.
Oct 12 '09 #9

P: 2
hey, glob is kinda like a file/directory strpos(), cept i doesnt return false, ever.

just use it like this:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $mydir = 'dir/sub-dir';
  3. $myext = '.htm';
  4. foreach(glob("$mydir/*$myext") as $item) {
  5.   echo "<li>$item</li>";
  6. }
  7. ?>
try it, after changing to $mydir and $myext.
Sep 17 '10 #10

P: 2
if you want to search inside files for a word...
thats harder. a LOT harder.
but you can do it.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     $mydir = 'dir/sub-dir';
  3.     $myext = '.htm';
  4.     foreach(glob("$mydir/*$myext") as $item) {
  5.         $inside = file_get_contents($item);
  6.         $findme   = 'my text';
  7.         $pos = strpos($inside, $findme);
  8.  
  9. // Note our use of ===.  Simply == would not work as expected
  10. // because the position of 'a' was the 0th (first) character.
  11. if ($pos === false) {
  12.     echo "<!-- not found in $item -->";
  13. } else {
  14.     echo "<li><a href='$item'>$item</a></li>";
  15. }
  16.     }
  17. ?>
Sep 17 '10 #11

Post your reply

Sign in to post your reply or Sign up for a free account.