If the "\" are showing up in form posted data just do this:

$newtext = stripslashes($oldtext);

The slashes are put before any single or double quote by a nifty little php
feature called "magic quotes". By escaping quotes in form posted data you
greatly reduce the risk of sql injections and other types of sneaky stuff.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "PHP List (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, July 24, 2002 5:30 PM
Subject: [PHP] Trouble with \


> Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.
>
> Turns out the \'s that I was having problems getting rid of were written
> there from a form post that was used to collect the data. I still haven't
> found a way to remove them after reading them from the file, but I did
> manage to change them before they were posted by doing a strtr.
>
> If someone has a way to clearn \'s out of a string brought in from a file,
> I'm all ears, but it's working now.
>
>
>
> --
> The Health TV Channel, Inc.
> (a non - profit organization)
> 3820 Lake Otis Pkwy.
> Anchorage, AK 99508
> 907.770.6200 ext.220
> 907.336.6205 (fax)
> Web: www.healthtvchannel.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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

Reply via email to