RE: [PHP] Stripping single quotes

From: Date: Sat, 28 Jul 2001 07:57:40 +0000
Subject: RE: [PHP] Stripping single quotes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60032@lists.php.net to get a copy of this message
Darn, it still 'aint working. Ok, let's say $fldemail contains "o\'brian@hotmail.com" I then run these: $fldemail == stripslashes($fldemail); $fldemail == ereg_replace("'","",$fldemail); And I get "o\'brian@hotmail.com" ... damn. Any ideas? Thanks, Matt Stone -----Original Message----- From: Chris Fry [mailto:chris@quillsoft.com.au] Sent: Saturday, 28 July 2001 2:15 PM To: Matt Stone Cc: PHP list Subject: Re: [PHP] Stripping single quotes Matt, Try ereg_replace:- $fldemail == ereg_replace("'","",$fldemail); Chris Matt Stone wrote: > Hi all, > I am trying to validate some email addresses before they are entered into > the database. > The problem is, some thick or malicious people are entering single quotes > into their email addresses. > I need to strip out all these single quotes but a little ole' str_replace > doesn't seem to be working. > Here it is: > > $fldemail == str_replace("'","",$fldemail); > > Nice and basic :) > Can anyone please enlighten me on this? > Thanks in advance, > > Matt Stone > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Chris Fry Quillsoft Pty Ltd Specialists in Secure Internet Services and E-Commerce Solutions 10 Gray Street Kogarah NSW 2217 Australia Phone: +61 2 9553 1691 Fax: +61 2 9553 1692 Mobile: 0419 414 323 eMail: chris@quillsoft.com.au http://www.quillsoft.com.au You can download our Public CA Certificate from:- https://ca.secureanywhere.com/htdocs/cacert.crt ********************************************************************** This information contains confidential information intended only for the use of the authorised recipient. If you are not an authorised recipient of this e-mail, please contact Quillsoft Pty Ltd by return e-mail. In this case, you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. This e-mail and any attachments may also contain copyright material belonging to Quillsoft Pty Ltd. The views expressed in this e-mail or attachments are the views of the author and not the views of Quillsoft Pty Ltd. You should only deal with the material contained in this e-mail if you are authorised to do so. This notice should not be removed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#60032) next »