Edit (Replace) on 400+ PHP Pages at once.

Discussion in 'PHP' started by mmelen, Apr 27, 2008.

  1. #1
    I need to replace some code on 400+ PHP pages.
    The code is multi-lined.
    Is there any program that will do this for me?

    And one more thing...
    I need to replace something that's different on every page.

    <param name="movie" value="XXXXXXXXX">
    <embed src="XXXXXXXXXX" width="650" height="450">

    The XXXXXXXXXX is different on each of my pages. (the .swf URL hard coded in).
    I figure that I want the URL to be retrieved from the Mysql database instead of hard coded on right away....

    But I can't really search for XXXXXXXXXX because it's different on every page... so I would need to search for (and replace) what's between embed src=" and width="650" height="450">

    Can I do that??
     
    mmelen, Apr 27, 2008 IP
  2. SecureWebDev

    SecureWebDev Active Member

    Messages:
    677
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    80
    #2
    how much you willing to pay?
     
    SecureWebDev, Apr 27, 2008 IP
  3. pdsllc

    pdsllc Well-Known Member

    Messages:
    180
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    if you have a macintosh, bbedit can do it
    for XXXXXXXXXX just do a grep search and replace
     
    pdsllc, Apr 27, 2008 IP
  4. pixens

    pixens Active Member

    Messages:
    481
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #4
    there is a software can do that, buzz me if you still in the dark. Something called "search and replace", is a freeware, I am sure i got it trashed somewhere
     
    pixens, Apr 27, 2008 IP
  5. mmelen

    mmelen Well-Known Member

    Messages:
    1,526
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Well I was hoping to find a freeware that can do it... so I guess 0?

    Hmm... Maybe I can get someone with a Mac that can help me?
    I don't want XXXXXXXXXX to be searched though (it's different per page) I need to find it by getting the stuff around it.

    Thanks a lot. If I still don't get an answer by tomorrow, I'll let you know.
     
    mmelen, Apr 27, 2008 IP
  6. thundercow

    thundercow Well-Known Member

    Messages:
    246
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #6
    This worked for me: RegEx Search/Replace Tool, which is available on Sourceforge. The java interface is a little weird, but it works on entire directories
     
    thundercow, Oct 17, 2008 IP
  7. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #7
    a good text editor can do the search & replace job on a directory including its subdirectory
     
    ads2help, Oct 17, 2008 IP
  8. thundercow

    thundercow Well-Known Member

    Messages:
    246
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #8
    You know, Notepad++ has this functionality built right into the search/replace function, and I am thinking now that this is the better way to do this.
     
    thundercow, Oct 17, 2008 IP