On Tuesday 11 February 2003 07:03, Shawn McKenzie wrote:
> Hmmm...  I guess no one is doing this???  Seems fairly common.

Patience. You should allow 1 day to give every list subscriber a chance to 
read your post.

> "Shawn McKenzie" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > 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?

The new recommended settings for magic_quotes_* are OFF so in psuedo-code:

INPUT
  get data from post/get and validate
  html_entity_decode() the data 
  addslashes() to data and insert into DB

OUTPUT
  get data from DB
  htmlentities() the data
  output it

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
The answer to the question of Life, the Universe, and Everything is...

        Four day work week,
        Two ply toilet paper!
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to