Jump to content

nslookup script help needed


simon26r
Go to solution Solved by dalecosp,

Recommended Posts

Hello

 

We are trying to capture and display on our website if a users connected or not to our dns filter

we need this to compare the true nslookup with one produced by our dns

 

This is the latest code thet dose not work

 

 


$ip = gethostbyname('www.facebook.com');

if ($ip == '46.123.70.198'); { //this is the ns after dns filter for facebook.com

    echo "Smart DNS Is Set up ";

} elseif ($ip == '193.123.9.65'): //this is true ns lookup

    echo "Smart DNS Is Not Set UP";

 

the error is T_ELSEIF on line 4

T_ELSEIF on line 4

 

If anyone can guide us it would be a great help or if you need not info 

 

Thanks 

 

 


 

 

Link to comment
Share on other sites

  • Solution

Rather a mess with your brackets there!

Is this better?

 

 

$ip = gethostbyname('www.facebook.com');
if ($ip == '46.123.70.198') { //this is the ns after dns filter for facebook.com
    echo "Smart DNS Is Set up ";
} elseif ($ip == '193.123.9.65') { //this is true ns lookup
    echo "Smart DNS Is Not Set UP";
}

Not sure where those extra semicolons and colons came from ... :)
Link to comment
Share on other sites

 

Hello
 
We are trying to capture and display on our website if a users connected or not to our dns filter
we need this to compare the true nslookup with one produced by our dns
 
This is the latest code thet dose not work
 
 
$ip = gethostbyname('www.facebook.com');
if ($ip == '46.123.70.198'); { //this is the ns after dns filter for facebook.com
    echo "Smart DNS Is Set up ";
} elseif ($ip == '193.123.9.65'): //this is true ns lookup
    echo "Smart DNS Is Not Set UP";
 
the error is T_ELSEIF on line 4
T_ELSEIF on line 4
 
If anyone can guide us it would be a great help or if you need not info 
 
Thanks 
 
 

 

 

Might want to pay attention to other posts that you have made:

http://forums.phpfreaks.com/topic/282391-whats-wrong-with-my-code/

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.