Recursive Search And Replace

by 12 replies
14
Hey Warriors,

Looks like my server has been hacked again. Ugh.

Anyway, I need to get my hands on a recursive search and replace script in PHP or PERL.

I could write one myself, but frankly, I'm sure there's a million of them out there.

If you know of one with good documentation, please list it. I need to get this taken care of ASAP.

Thanks.
#programming #recursive #replace #search
  • Ultraedit has this. Can use regular expressions for the search and replaces.

    Not sure if it goes through multiple files though.

    Dreamweaver (you could always download the trial) definitely does go through all files in a folder, though.
    • [1] reply
    • I'm hoping to avoid reg exp, first of all because I want to shoot myself when I use them, and secondly it's one string that I need to remove from every file on my server.

  • You can use both UltraEdit's and Dreamweaver's search and replace normally (by string) too; I was just pointing out that they have powerful features (whereby you can use regexes) if needed.

    But yeah, they're both suitable for a simple search and replace
    • [1] reply
    • Thanks Tristan.

      P.S. Good on you for the Firefly avatar
      • [ 1 ] Thanks
  • UltraEdit would work great for this task.

    Another fine choice is PS Pad, unlike UltraEdit it's a free text editor (to be fair you can download a free trial of UltraEdit):

    editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor

    Bill
  • These sound good, but all the files are server-side, and I'd like to keep them there.

    So, if I can find something I can run via SSH, that would be best. That's why I'd like one in PHP or PERL. BASH may even work well.
    • [2] replies
  • I think I know what your problem is .... your PC is infected with a virus... Scan your entire PC with a good antivirus (QuickHeal,Avira) ...... also, some types of viruses delete the bottom part of the page.... so simple replacing may not work ....

    I use lacehost.com for hosting (do not go by their site design) and they really are very helpful in these matters .....
    • [1] reply
    • Yeah, the server got hit by something. The majority of the files now have a stupid one liner at the very bottom that attaches lots of virus's to whoever views the page.

Next Topics on Trending Feed