topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday December 14, 2024, 4:12 am
  • Proudly celebrating 15+ 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 6652 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 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: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #1 on: May 21, 2012, 09:43 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 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 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: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: php? program on webhost needed
« Reply #4 on: May 21, 2012, 10:25 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 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 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