Jump to content


Photo

PHP Searching W/o SQL??


  • Please log in to reply
10 replies to this topic

#1 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 10:06 PM

I can't figure out a way this could be done, anyone have any scripts or like websites they can direct me to?

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 08 October 2006 - 10:13 PM

What type of document are you search?

me!

#3 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 10:15 PM

any type, mostly, png, gif, jpg, php and inc

#4 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 October 2006 - 10:18 PM

You'll need to explain yourself a little better. Do you want to search through these documents or for these documents. I assume the latter as the files you have specified dont contain textual data.

#5 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 10:23 PM

Like, containing words in the document.

Like a simple user search script, they type in what they want to find, and it comes up with pages including the text they searched for

if that's understandable

#6 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 11:19 PM

anybody?

#7 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 08 October 2006 - 11:24 PM

You can't search inside image files, I mean you could if you hex the data, but why would you, there is no real text strings in them. Like thorpe, give a good example of what you want to search for...

me!

#8 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 11:26 PM

ok, how about just inc and php files?

like searching for TEXT not any php inside it

#9 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 08 October 2006 - 11:41 PM

Your still not being real clear. To search for text in a file you could simply use something like....

<?php
  $file = "filetosearch.txt";
  $term = "termtosearchfor";
  $fp = file_get_contents($file);
  if (strstr($fp,$term)) {
    echo "$term found in $file";
  }
?>


#10 marcus

marcus
  • Members
  • PipPipPip
  • Advanced Member
  • 1,842 posts
  • LocationRochester, NY

Posted 08 October 2006 - 11:58 PM

ok, let's like just search a whole website

#11 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 09 October 2006 - 12:50 AM

http://www.google.co...ipt&btnG=Search
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users