SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: stripslashes, addslashes help!
-
Apr 17, 2001, 14:22 #1
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Got a problem. I am trying to store something like:
^.+@.+\\..+$
in the database but don't know the best way to do it. If i just put it in normally and call out normally it does not work so know i need to do something, but not sure what.
If i have
^.+@.+\..+$
in the database, when i take it from the database it works as if it was ^.+@.+\\..+$ so i thought that i should try and remove a slash from before i put it in, but doing
stripslashes(^.+@.+\\..+$)
removed both of them...
confused as you can tell
-
Apr 17, 2001, 14:56 #2
- Join Date
- Nov 2000
- Location
- Hong Kong
- Posts
- 1,508
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try:
$text = "^.+@.+\\..+$";
$text = addslashes($text);
Then when you take out of the database do:
$text = stripslashes($text);
print $text;
-
Apr 17, 2001, 15:10 #3
- Join Date
- Feb 2000
- Location
- England
- Posts
- 568
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thank you so so so much it worked.
however, it made no difference if i used stripslahes($text) or not, istn't that a bit weird?
-
Apr 17, 2001, 15:47 #4
- Join Date
- Nov 2000
- Location
- Hong Kong
- Posts
- 1,508
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yup, but hey it worked!
Last edited by petesmc; Apr 17, 2001 at 16:00.
Bookmarks