Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Aug 2006
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I combine these two pieces of code?

    Hi,

    How do I combine these two pieces of code?

    if($quot['IDQuoteStatus'] == 2 && $_SESSION['loggedIn']->getID() == 20 )

    and if(preg_match("/^192.128{1}/", getenv(REMOTE_ADDR)))

    but rather if it's NOT coming from that IP Range.

    So basically if quotationsatus ==2 and getID ==20 and NOT coming from that above IP Range


    If it's this:

    elseif ($quot['IDQuoteStatus'] == 2 && $_SESSION['loggedIn']->getID() == 20 && (!preg_match("/^192.128{1}/", getenv(REMOTE_ADDR))))
    $html .= "<input type='button' class='button' value='".$this->lang['est']."' onClick=\"javascript:alert('You cannot access this page')>";


    If that's it, i'm missing a " somewhere
    can anyone locate where assuming that this snippet would work?
    Last edited by LondonBoy; 11-29-2006 at 06:46 PM.

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    Tadley, UK
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts
    PHP Code:
    elseif ($quot['IDQuoteStatus'] == && $_SESSION['loggedIn']->getID() == 20 && (!preg_match("/^192.128{1}/"getenv(REMOTE_ADDR))))
    $html .= "<input type='button' class='button' value='".$this->lang['est']."' onClick=\"javascript:alert('You cannot access this page')\">"
    That will work...

  • #3
    Regular Coder
    Join Date
    Aug 2006
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx bro
    how do I mark this as resolved?

  • #4
    New Coder
    Join Date
    Apr 2006
    Location
    Tadley, UK
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts
    You don't need to, Glad it worked though


  •  

    Posting Permissions

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