Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-29-2006, 05:27 PM   PM User | #1
LondonBoy
Regular Coder

 
Join Date: Aug 2006
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
LondonBoy is an unknown quantity at this point
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 05:46 PM..
LondonBoy is offline   Reply With Quote
Old 11-29-2006, 06:20 PM   PM User | #2
Webmonkey
New Coder

 
Join Date: Apr 2006
Location: Tadley, UK
Posts: 63
Thanks: 5
Thanked 0 Times in 0 Posts
Webmonkey is an unknown quantity at this point
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...
__________________
Steven Gibbons
klearconcepts@gmail.com
Webmonkey is offline   Reply With Quote
Old 11-29-2006, 06:22 PM   PM User | #3
LondonBoy
Regular Coder

 
Join Date: Aug 2006
Posts: 105
Thanks: 0
Thanked 0 Times in 0 Posts
LondonBoy is an unknown quantity at this point
thx bro
how do I mark this as resolved?
LondonBoy is offline   Reply With Quote
Old 11-30-2006, 09:04 PM   PM User | #4
Webmonkey
New Coder

 
Join Date: Apr 2006
Location: Tadley, UK
Posts: 63
Thanks: 5
Thanked 0 Times in 0 Posts
Webmonkey is an unknown quantity at this point
You don't need to, Glad it worked though
__________________
Steven Gibbons
klearconcepts@gmail.com
Webmonkey is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:31 PM.


Advertisement
Log in to turn off these ads.