How to make my web page editable.. – PHP

  php

Q(Question):

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.

http://en.wikipedia.org/w/index.php?…ge&action=edit

help me to slove this.

A(Answer):

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_contents, display it in a <textarea> and the save it again when the user submits it.

A(Answer):

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_contents, 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.

A(Answer):

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?

A(Answer):

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_contents, str_replace and file_put_contents 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).

A(Answer):

Is your webpage content coming from a Database?

yes it’s content coming from Database…

A(Answer):

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_contents, str_replace and file_put_contents 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…

LEAVE A COMMENT