473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

REMOTE_ADDR in IIS

Hi,

In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']

regards,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 24 '05 #1
6 4166
aabrahao wrote:
In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']


Check the output of phpinfo() to see if anything useful is in there.
JW

Jul 24 '05 #2
aabrahao wrote:
Hi,

In IIS 6, windows 2003 with php 4.3.11, the code REMOTE_ADDR
does not show the IP, but the same page in apache2triad shows the
IP.
I tried
<? $ip = getenv("REMOTE_ADDR"); print $ip; ?>
and
$_SERVER['REMOTE_ADDR']

regards,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm


The environment variables are set up by the server, and Apache and IIS don't
necessarily share the same values.

The suggestion to use phpinfo() is a good one - it will show you just what you
have in IIS - which will be different from Apache.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 24 '05 #3
There is the link from the IIS server:

http://www.hij.com.br/helpme/phpinfo.php

Thanks,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 25 '05 #4
On Mon, 25 Jul 2005 17:07:00 -0000,
ar***********@terra.com-dot-br.no-spam.invalid (aabrahao) wrote:
There is the link from the IIS server:

http://www.hij.com.br/helpme/phpinfo.php


That page shows REMOTE_ADDR set correctly under the "ISAPI" section, which
should therefore appear in $_SERVER...

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 25 '05 #5
Hi,

Yes, the $_SERVER['REMOTE_ADDR']; is working.
I made some changes in the windows security at the php folder,
maybe was coincidence.
But the $ip = getenv("REMOTE_ADDR"); print $ip; realy does not
work, why?
Why its works in apache2triad and don't in IIS?

Thanks,

http://www.DevPlug.com --Connecting Developers
Posted from: http://www.devplug.com/ftopic57612.htm
Jul 26 '05 #6
aabrahao wrote:
Why its works in apache2triad and don't in IIS?


From: http://phplens.com/phpeverywhere/node/view/32

"For ISAPI modules, the server varibles are stored in the $_SERVER array.
For CGI, they are stored as environment variables, available from the $_ENV
array or getenv( )."
JW

Jul 27 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: bawar | last post by:
I want to put a script on my site that shows how many users are online on my site. I found one, and that is shown below. It also shows a log with the IP-addresses of those visitors. Buuut... the...
1
by: Pat | last post by:
Hi, I am having a small problem with a script that has to be requested via https. When I execute this normally I get my IP address printed on the screen: <?php echo getenv('REMOTE_ADDR');
7
by: deko | last post by:
Why is $_SERVER returning multiple IP Addresses? Actually, I'm not sure if it's $_SERVER -- or which if/else statement -- that's the problem, but what I'm getting as a value for $visip looks...
5
by: Sachin Singhal | last post by:
Hi All, I am in a bit of fix. In one of my setup, the server REMOTE_ADDR(url = Request.ServerVariables("REMOTE_ADDR")) does not work, itgives a IP address but the wrong one. It does not give the...
2
by: xarrisx | last post by:
I have a web server with a firewall. The problem is that when i use request.servervariables("remote_addr") the ip i get is my server's ip. Is there any other way to retrieve my visitor's ip? ...
7
by: Jason | last post by:
Hi, The javascript in my page is not working, itstead of alerting me the ip address, it alerts me with string "<!--#echo var="REMOTE_ADDR"-->". var ip = '<!--#echo var="REMOTE_ADDR"-->';...
4
by: ojorus | last post by:
Hi. I have a problem when I use the $_SERVER. I'm testing a script, and the strange thing is that remote_addr returns an ip-address only sometimes, and not always. Why can that be? Are there any...
3
by: Frank Moyles | last post by:
What is the equivalent for retrieving server side variables? For example in PHP, one such predefined variable is: $_SERVER
2
by: Henry Stock | last post by:
I don't seem to understand how to use the value: Request.ServerVariables("remote_addr") I am trying to pass the ip address of a sending web client in the body of an email message. When I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.