By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

How to make my web page editable..

P: 11
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.
Sep 17 '08 #1
Share this Question
Share on Google+
6 Replies


Atli
Expert 5K+
P: 5,058
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.
Sep 17 '08 #2

P: 11
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.
Sep 17 '08 #3

Markus
Expert 5K+
P: 6,050
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?
Sep 17 '08 #4

Atli
Expert 5K+
P: 5,058
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).
Sep 17 '08 #5

P: 11
Is your webpage content coming from a Database?
yes it's content coming from Database...
Sep 20 '08 #6

P: 11
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...
Sep 20 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.