Hi. I’m hoping that someone can tell me once and for all how to properly take user input from a textarea or input field, and put it in a mysql table. Then read from the table and display the inputted text exactly how it was entered.
I’d preferably like to do the php stuff via an ajax call that is initialized onclick on some button.
What I’m looking for is the javascript to read from the input and prepare the text for passing to an ajax call to the php file (I don’t need all the ajax stuff, just what to do with the string before passing it).
Then what to do in php before writing it to the table.
Then what do I do with the string I get from mysql_fetch_array before I insert it, say, between <p></p> tags so that it displays exactly how the user entered it.
I looked all over the web and there’s a whole bunch of different ways of doing it. Just applying php’s htmlentities() almost works, but single and double quotes keep screwing it up.
Thanks,