SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    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

  2. #2
    <? echo "Kick me"; ?> petesmc's Avatar
    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;

  3. #3
    SitePoint Evangelist
    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?

  4. #4
    <? echo "Kick me"; ?> petesmc's Avatar
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •