SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to search line in files online

    Hi,
    i am validating a php website which many php includes, is there any way we can find a line of code from folder of files or from complete website online.

    All help appreciated!

  2. #2
    SitePoint Evangelist Andrewaclt's Avatar
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    535
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, you must have access to the source of the php. If it's a linux server you can use grep and search the folders with ease. Not sure how to do it on windows.

  3. #3
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is the subject site on your server? Saying code, you mean php source code?

    If the answer to both question is yes, that is not possible. You can only access an output of a php scripts.

    If the answer to the second question is no and it is the php output that you want, use file_get_contents and str or preg functions to find text.

    Crawling an entire directory is a bit more difficult task. It is a model of search engine spider; you either must have a sitemap or look for link starting at page one.

    If the answer to the first question is no, use glob, file_get_contents and str or preg funtions. It is a rather easy task as the files are on your server.
    Saul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •