Can I use PHP to change HTML files on server-side?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GoldenSpider
    Confirmed User
    • Feb 2003
    • 347

    #1

    Can I use PHP to change HTML files on server-side?

    I have thousands of static HTML files on server, but I wanna change a bit code to each one em now, can I do it via a PHP script? which function?
    Thank You!
  • Kevsh
    Confirmed User
    • Dec 2004
    • 8619

    #2
    Why not use a global search and replace? HomeSite, for example, offers this feature and also supports regular expressions.

    Comment

    • Yahook
      Confirmed User
      • May 2002
      • 840

      #3
      http://scripts.xrenoder.com/sr.txt - try this script - description is in russian but if you know php a bit you can use it

      Do you have ICQ?

      Comment

      • kernelpanic
        Too lazy to set a custom title
        • Jan 2005
        • 2961

        #4
        It shouldn't be too hard to homebrew one.

        http://us4.php.net/function.file

        http://us4.php.net/preg-replace


        Open file -> replace all matched patterns -> output file


        ZangoCash - Turn Your Traffic Into Ca$h.
        $.40 Per Install - No Tier

        Comment

        • WWC-Hagan
          Confirmed User
          • May 2004
          • 78

          #5
          i don't know if that can be done in PHP, but i have a PERL script that i use all the time to do tasks like that. hit me up on ICQ
          SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, you may use a 624x80 instead of a 120x60. Let me repeat... A 120 x 60 button and no more that 3 lines of DEFAULT SIZE AND COLOR text.

          Comment

          • coolasafanman
            Registered User
            • Aug 2003
            • 73

            #6
            yes you can do it, but if you're asking how to go about it, you'd be better off using a text editor, downloading the files and doing a find/replace as suggested above. You'll also need to play around with fopen http://us2.php.net/fopen and file permissions might be an issue (chmod).


            icq 169177917

            Comment

            Working...