Jump to content

nslookup script help needed


simon26r

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
https://forums.phpfreaks.com/topic/282424-nslookup-script-help-needed/
Share on other sites

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 ... :)

 

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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.