Edit a file's div section only using PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samvb
    New Member
    • Oct 2006
    • 228

    #1

    Edit a file's div section only using PHP

    Hi:)

    I have a series of pages that are totally static [no db required]. I dont want to use databases unless it is impossible. The contents of this page is stored in the main div section named maincontent.

    Is there anyway i could update that section only from PHP? That is, make changes to the file?

    I need to change the file but update only that section?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Depending on your PHP version have a look at the DOM and DOMXML extensions. You can use these to work with your HTML.

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      What is the governing force that determines what changes are going to be made to this page? Is it based on database entries?

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        Javascript function innerHTML() may be useful

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by code green
          Javascript function innerHTML() may be useful
          As far as I remember innerHTML is an HTMLElement's (I probably got the object wrong) property. That is, it is not a function: el.innerHTML = "Some text"

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            correct, innerHTML is not a function.

            Comment

            • samvb
              New Member
              • Oct 2006
              • 228

              #7
              thanks for all your replies guys. I want to make a permanent change (like edit a file and save it in notepad) with php. The section i want to edit is a div named content. the file is not associated with db by all means. Its a plain html file that i need to access from php, make changes in the div section and update the changes.

              Comment

              • kovik
                Recognized Expert Top Contributor
                • Jun 2007
                • 1044

                #8
                Then like I said, what is the governing force? What is it that you do that requires this page to be updated?

                Comment

                Working...