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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.