On Mon, Jun 03, 2002 at 11:15:15AM -0600, Jas wrote:
>
> In order to view the contents of the file in the
> text area I had to setup a eregi_replace("<","&a&") string.

&'s are not legal in HTML.  You need to escape them.  When pulling stuff 
out of the file, use htmlspecialchars() before displaying the text in 
your form.

THEN, when you're putting the user input from the form back into the 
file, use this:

   $Replace['&amp;']  = '&';
   $Replace['&lt;']   = '<';
   $Replace['&gt;']   = '>';
   $Replace['&quot;'] = '"';

   $UserInput = strtr($UserInput, $Replace);

--Dan

-- 
               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution
    sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409

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

Reply via email to