Re: wierd form output

From: Date: Fri, 06 Oct 2000 02:19:26 +0000
Subject: Re: wierd form output
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-18816@lists.php.net to get a copy of this message
On Fri, 06 Oct 2000, Randy wrote: > At 09:04 PM 10/5/00 -0400, Daniel Convissor wrote: > >Hey Bryan: > > > >> characters. If the user enters \\, hits submit, it > >> will put \\\\ in the field. If hit again, double that > >> and so on. > >> Does this have something to do with stripslashes()? > > > >Kind of. Addslashes() or magic_quotes_gpc is putting the "\" in there. Best > >solution is to clean user input on the way into your scripts. That way you > >can pull out unwanted characters there and avoid such problems. > > But what if the user inputs this for example: I'm in love with your site! > > and it comes out I\'m in love with your site! How can this be stopped? > > Randy Like the man says, clean the input before displaying it with the complement to addslashes which is stripslashes. Anywhere there is a faint possibility that someone might put a / or ' use echo stripslashes($variable) to tidy it for display. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#18816) next »