www.webdeveloper.com
Results 1 to 5 of 5

Thread: search through your php file content on the server?

  1. #1
    Join Date
    Nov 2006
    Posts
    64

    search through your php file content on the server?

    Does anyone know of any FTP or other software that will search for a string within your php files that are on the server (in the raw code)?

    For example I want to search for "<div id='thetitle'>" and/or "<?php $var1 = 3;" within a directory of PHP files on the server.

    Any thoughts?
    Hey, I like potatoes!
    Support the wwf org!

  2. #2
    Join Date
    Oct 2010
    Location
    Ohio
    Posts
    233
    If the server is *nix and you have SSH access you can use grep to find all occurences of a string in all files in a folder, a specific file or recursively for everything in a folder at any level below.
    ~Ryan
    www.rdennispallas.com <-- Personal Site, changing regularly cuz its ugly.

  3. #3
    Join Date
    Nov 2006
    Posts
    64
    http://download.cnet.com/Grep/3000-2094_4-94069.html is the right one? At the risk of not sounding techie, how do I know if I have SSH or not?
    Hey, I like potatoes!
    Support the wwf org!

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,408
    Another option (i.e. if you don't have ssh or other access to the web server's command line interface), would be to write a little PHP script. At the simplest:
    PHP Code:
    <pre>
    <?php
    chdir
    ('the/desired/directory');
    passthru('grep "<div id=\'thetitle\'>" *.php');
    ?>
    </pre>
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  5. #5
    Join Date
    Nov 2006
    Posts
    64
    that does sound more fun.
    Hey, I like potatoes!
    Support the wwf org!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles