Re: [PHP] Problem with backslashes disappearing

2002-03-06 Thread Richard Crawford

Have you tried escaping the backslash character with another one: \\?


On Wed, 2002-03-06 at 06:34, Torkil Johnsen wrote:
 Hello!
 
 I have a simple form taking in some user text input and storing it in a
 mysql database. My problem is that PHP strips off any backslashes in the
 text. I realize that backspace is used as an escape character in PHP, but
 sometimes i DO want it in there!!
 
 Is there a way to do this so that I can store them? For example replacing
 the backslash with some code? Like amp; can replace ?
 
 Anyone?
 
 - Torkil
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Sliante,
Richard S. Crawford

mailto:[EMAIL PROTECTED]  http://www.mossroot.com
AIM:  Buffalo2K   ICQ: 11646404  Yahoo!: rscrawford
MSN:  [EMAIL PROTECTED]

It is only with the heart that we see rightly; what is essential is
invisible to the eye.  --Antoine de Saint Exupery

Push the button, Max!



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




RE: [PHP] Problem with backslashes disappearing

2002-03-06 Thread Dan Vande More

try

$new_string=addslashes($old_string);

before doing anything else with it.
This will prevent from anything removing the  \ ' etc because they will all
automagically be escaped with that command.
When you pull the data back out use:

$newer_string=stripslashes($new_string);
Dan

-Original Message-
From: Torkil Johnsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 06, 2002 7:34 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with backslashes disappearing


Hello!

I have a simple form taking in some user text input and storing it in a
mysql database. My problem is that PHP strips off any backslashes in the
text. I realize that backspace is used as an escape character in PHP, but
sometimes i DO want it in there!!

Is there a way to do this so that I can store them? For example replacing
the backslash with some code? Like amp; can replace ?

Anyone?

- Torkil


-- 
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