How to make my web page editable..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vivekshekar
    New Member
    • Jul 2008
    • 11

    How to make my web page editable..

    Hello,

    I have developed one web site, In that i want to add a tool for viewers to edit the current page.

    For example in wikipedia there having one tool for edit This page(sand box), here is the Link for that edit page.



    help me to slove this.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hi.

    How is the data on that page stored?

    If it's a simple HTML page, you could just fetch the content of that page using a function like file_get_conten ts, display it in a <textarea> and the save it again when the user submits it.

    Comment

    • vivekshekar
      New Member
      • Jul 2008
      • 11

      #3
      Originally posted by Atli
      Hi.

      How is the data on that page stored?

      If it's a simple HTML page, you could just fetch the content of that page using a function like file_get_conten ts, display it in a <textarea> and the save it again when the user submits it.
      HI

      Thank's for your kind reply.

      But i dont want to put the file content.My query is , for ex: There is one line of mathematics equations and in that forum if any body want to add a line about that equation i should let them add.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by vivekshekar
        HI

        Thank's for your kind reply.

        But i dont want to put the file content.My query is , for ex: There is one line of mathematics equations and in that forum if any body want to add a line about that equation i should let them add.
        Is your webpage content coming from a Database?

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          So you want people to be able to add text into a static HTML file?
          Something like a comment system you might find on a blog.

          The simplest way would probably be to have a HTML file that contains a placeholder of sorts, where you want new lines to be added.
          Then you could load the entire file into your PHP code and replace that placeholder with the new line, adding a new placeholder after that line, and finally overriding the old HTML file with the new one.

          That wouldn't be hard to implement, and would just require basic knowledge of PHP.
          Look into the file_get_conten ts, str_replace and file_put_conten ts functions if you want to try it out.

          That is, obviously, not the best way to do this, but is is the simplest.
          Other, more refined methods, would involve some sort of a database, and a PHP code that would assemble the page on each request (or possibly create a cached file... but that's a while another issue).

          Comment

          • vivekshekar
            New Member
            • Jul 2008
            • 11

            #6
            Originally posted by Markus
            Is your webpage content coming from a Database?
            yes it's content coming from Database...

            Comment

            • vivekshekar
              New Member
              • Jul 2008
              • 11

              #7
              Originally posted by Atli
              So you want people to be able to add text into a static HTML file?
              Something like a comment system you might find on a blog.

              The simplest way would probably be to have a HTML file that contains a placeholder of sorts, where you want new lines to be added.
              Then you could load the entire file into your PHP code and replace that placeholder with the new line, adding a new placeholder after that line, and finally overriding the old HTML file with the new one.

              That wouldn't be hard to implement, and would just require basic knowledge of PHP.
              Look into the file_get_conten ts, str_replace and file_put_conten ts functions if you want to try it out.

              That is, obviously, not the best way to do this, but is is the simplest.
              Other, more refined methods, would involve some sort of a database, and a PHP code that would assemble the page on each request (or possibly create a cached file... but that's a while another issue).
              Thank u so much........
              Ill try this out. If i got any doubt help me like this only...

              Comment

              Working...