Jump to content

Displaying formatted data from database into html textareas and fields


bbsemail

Recommended Posts

I am new to AJAX and I created a page to allow the pastor of my church to input/upload her sermons and modify them at a later date.  However, when I process the responsetext from a php database query, the form fields are being terminated with a backslash.  Any idea why, or do I just need to "trim" the string?

My database field that stores the sermon sometimes has embeded html code, how do I "print" the formatted content for the pastor to edit?  Should I, can I format the data before putting it into the response string before sending back the response string? 

I could use xml, but the sermon field in the database doesn't have a uniform structure from week to week.

The test page is available here: [url=http://www.stephenschurch.org/sermonsTEST.php?admin]http://www.stephenschurch.org/sermonsTEST.php?admin[/url]

Thanks for any help.
brad
As to the backslash, you seem to be running with get_magic_quotes set to On, so all GET data will be escaped with addslashes as default. Run stripslashes before echoing it.
When that is said, you seem to have a mix of content and html here and that's not a user friendly solution at all, and unless your pastor is keen on learning html i would really reconsider this to storing pure text in the database instead and format it visually where it's supposed to be - when displaying it inside a layout.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.