[PHP-WIN] Re: Crazy user input with html in it

2005-05-27 Thread Louis Solomon [SteelBytes]
when storing, use mysql_real_escape_string (or equiv for what ever db) eg, $query = 'insert into table set field=\''.mysql_real_escape_string($valuefromuser).'\', set field2=... when displaying user input (not matter where from), use htmlentities() eg, echo htmlentities($string_from_db); -- Lou

[PHP-WIN] Re: [PHP] Stopping users to see uploaded files

2005-05-27 Thread Michael Adams
On Fri, 27 May 2005 11:59:53 +0100 symbulos <[EMAIL PROTECTED]> wrote: > Dear friends, > > we are using php for developing a small tool for uploading files for > download > (publications). Using the usual move_uploaded_file, the publications > are loaded into a directory where the webserver can

[PHP-WIN] Crazy user input with html in it

2005-05-27 Thread Ross Honniball
Hi all, Say you get some text field from a user and store it in a database. Then later you display this input. If the user has coded html in the actual input, without running this through some kind of parsing function, it could give you some odd results. For example, say the user types in, a