Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 05:20:40 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: php? program on webhost needed  (Read 1750 times)

IdiotSavant

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
IDEA: php? program on webhost needed
« on: May 21, 2012, 09:18:08 PM »
I have a large website (over 5k pages in many directories) that I need to change the phone number in each page.  I don't know how easy or hard it would be to code something to run on the webserver that would find and replace a string of text.
Any attempts will be appreciated.
IdiotSavant

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 591
  • what am I doing in this handbasket?
    • View Profile
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #1 on: May 21, 2012, 09:43:33 PM »
You could look at <ahem> FART (that's Find And Replace Text).

Or, similarly, GSAR (General Search And Replace) would do it.

I have used both in several batch processes.
vi vi vi - editor of the beast

IdiotSavant

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #2 on: May 21, 2012, 09:53:22 PM »
Thanks, I'll check them both out.
IS

IdiotSavant

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #3 on: May 21, 2012, 10:02:12 PM »
It looks to me like these both are windoze.  My webhost account is a linux account. Guess I should have made that clear.
Thanks though
IS

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #4 on: May 21, 2012, 10:25:54 PM »
I'm sure there is some existing php code to do search+replace over multiple files, BUT if someone wants to make a new tool that does this, I have written some php classes and code that should make the job much easier, in my (open source) mwimporter package.  Again, it does *not* do search and replace, but it will nicely iterate through recursive directories of files and do a few more helpful things that could be used as a starting point.
« Last Edit: May 22, 2012, 07:15:00 AM by mouser »

IdiotSavant

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #5 on: May 22, 2012, 06:42:21 AM »
 :Thmbsup: After looking at your package, I thought about my situation again and realized I already have a sitemap I could operate on so now I just need to find something that will take that and search/replace over the files.  I'll look for it.
IS