That is the right answer though... along with the various magic_quotes flags in the configuration.
You need to look at your existing settings and then create a simple test where you type in something such as: x'x"x\x and then spit it out and save it and generally see at what point slashes are being added. There's a couple of ways to do it... put slashes in automatically, strip them on display don't do it automatically, add them before insertion to a database but which one is easiest for you depends on your sites configuration and what code you've already written, etc... -philip On Mon, 10 Feb 2003, Shawn McKenzie wrote: > Is more info needed, or was everyone just going post replies like: > > "see stripslashes() and htmlentities()" > > ******************************************************* > > I have a form and I want the user to be able to enter html in a text area. > This will then be stored in an array in a config file. Example > $htmlstuff[1] = '<script type="text/javascript>some stuff here</script>'; > > When they visit the form again it will display as they entered it and they > can modify it and save it back to the array. The problem is I keep getting > multiple \ on the single and double quotes every time they submit the form, > as well as multiple newlines and trailing spaces. > > I have looked at and tried combinations of stripslashes(), > htmlspecialchars() and htmlentities(), so I don't need a link to the PHP > manual. I can't find the right combination and don't know when to do what > to get this to work. Can anyone give me a good example? > > Serious help appreciated... > > Thanks! > -Shawn > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php