...

View Full Version : How do I combine these two pieces of code?



LondonBoy
11-29-2006, 05:27 PM
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?

Webmonkey
11-29-2006, 06:20 PM
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')\">";

That will work...

LondonBoy
11-29-2006, 06:22 PM
thx bro
how do I mark this as resolved?

Webmonkey
11-30-2006, 09:04 PM
You don't need to, Glad it worked though :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum