SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How would you add this please ?

    Hi, any ideas how you could adapt the code below, to also exclude (at) please ?

    PHP Code:
        if ($user->data['user_posts'] < 10)
           {
             if (
    preg_match('/(@)/i'request_var('message'''true)))
                {
                 
    $error[] = $user->lang['NO_EMAILS'];
              }
           } 

  2. #2
    messing with my mind fristi's Avatar
    Join Date
    Feb 2009
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dez View Post
    Hi, any ideas how you could adapt the code below, to also exclude (at) please ?

    PHP Code:
        if ($user->data['user_posts'] < 10)
           {
             if (
    preg_match('/(@)/i'request_var('message'''true)))
                {
                 
    $error[] = $user->lang['NO_EMAILS'];
              }
           } 

    like this?
    PHP Code:
    if ($user->data['user_posts'] < 10) {
        if (
    preg_match('/(@|\(at\))/i'request_var('message'''true))) {
            
    $error[] = $user->lang['NO_EMAILS'];
        }

    To PHP or to Perl, that is the question!
    (Bucket - simpletest) User

  3. #3
    SitePoint Wizard
    Join Date
    Jun 2005
    Posts
    1,428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Absolutely perfect

    It was the brackets parts that was throwing me, obviously weren't escaping them properly.

    Many thanks for the quick help Fristi


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
  •