Page 1 of 1

inserting html into a database

Posted: Sat Nov 22, 2008 3:04 pm
by ranmma15g
Here's what I want to pull off

1.) I have a form setup to accept html data with double quotes and all that

2.) user enters html data into the form and submits

3.) php runs a script that takes data from form and inserts the html code into the sql database while taking special characters and automating the process of escaping the special characters for you so that you don't need to insert them yourself.

4.) When the data is saved in the sql database, if returned as a value, it would look exactly like it did when it was entered into the database.

Now mind you, I'm not even concerned with step four yet, because I'm not too sure if there's a way that you can get special characters like double quotes inserted without having that escaping slash in there in the first place. If the data was inserted into the sql with a filter as described from above, would it still look like it was in the form after it was filtered, or would the escaping characters be included?

Re: inserting html into a database

Posted: Sat Nov 22, 2008 3:31 pm
by Syntac

Code: Select all

set_magic_quotes_runtime(0);