![]() |
| ||
| Server Address vs DNS I have some code that is called from with other files, using readfile so there is no referer etc. To authenticate that the request is where it should be from, the php is passed a calling url as part of it parameters. The idea is that I can then check the calling IP is from the correct machine. This works fine in most cases, however on some machines (I'm guessing VPS) the Server address is not what the DNS returns even though the domain name is hosted on that PC. Here is my code. $ip = gethostbyname($domain); In theory the REMOTE_ADDR and the IP returned from gethostbyname should match but they don't anybody any ideas how to get round this? |
| ||
| Re: Server Address vs DNS try these line and see what you get? <?php best of luck with the job. |
| ||
| Re: Server Address vs DNS Surely on a shared serverm that would just give you the name of the shared server, not the domain name that is calling you. |
| ||
| Re: Server Address vs DNS The domain probably has more then one IP. Try: http://www.php.net/manual/en/functio...ostbynamel.php and do a in_array() on the list of IPs. http://www.php.net/in_array |
| ||
| Re: Server Address vs DNS |
| All times are GMT -4. The time now is 4:00 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC