Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to save the whole given paragraph in the database in PHP, because it will be editable for the user in the future through the adminal panel of website.


PHP
<div id="para" name="graph">
<h2> It is a Example</h2>
<p>
This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle.This is the expamle...
</p>
</div>


What I have tried:

I have tired many things but all in vain. please help to solve this problem.
Posted
Updated 11-Aug-16 8:30am
v2

1 solution

Either you need to learn how to use forms: [here]
or
give your paragraph an id and use the javascript DOM to read the content of your element [here]

You'll also need to have a database, someplace, and be able to access it. If it's on the server-side, you may need php.
 
Share this answer
 
Comments
Member 11063279 15-Aug-16 10:46am    
Just Consider i have a Paragraph, now i want to save it in the database and then after saving want to show it on the Page. Please help me how can i do it?
W Balboos, GHB 15-Aug-16 10:50am    
Use the links in my answer so that you learn how to get data from your page back to the server. There are several ways to do this.

Depending upon the languages you use and the database available, once the data gets to the server you need to write it to the database.

The reverse process lets you recall the data from the database and send it back to the client side for the user.

You may need to learn a server-side language if you don't know one, such as .php.
Member 11063279 15-Aug-16 11:01am    
you are saying that i will access my data by making the external file?
please define me little bit more.. :(
I have paragraph like this
<p id="p1">

Some text


<p> Some text.....................................................................
</p>
</p>

please help me how can i save it?
W Balboos, GHB 15-Aug-16 12:01pm    
My answer included links to tutorials on how this is done. If you don't read them you'll never know how to do the task. If it's too much trouble to read the tutorials so that you can learn how to do these things then perhaps you're in the wrong field of study?
Member 11063279 15-Aug-16 12:32pm    
Thank you very much. i have done it :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900