473,738 Members | 10,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4187
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*******@attgl obal.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***********@t erra.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.andyhsoftwa re.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
5746
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 counter always stays on 1... When I look at the log, every visitor seems to have the same IP-address. When I look up that address, I see it is from the host of my webspace. Can someone offer me a solution? Thanx,
1
3554
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
12291
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 like this: 172.16.42.181, 62.138.35.94 Why am I getting more than one IP Address? Which IP is the originating IP Address? Is there a way to get only the originating IP?
5
11335
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 IPaddress of the machine surfing the page. It seems to me that itis giving me the IP of some proxy server. Is there a work around to this issue ? Any ideas ? Thanks a lot, Sachin
2
5245
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? Looks like the firewall cought the visitor's request and then request's this page from the web server-and send it back to the visitor.(but still i am not sure if this is what happens) If i have to reconfigure my firewall can you give me some info...
7
14748
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"-->'; alert("Your IP address is "+ip); How do I fix the problem? Thanks.
4
2140
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 other (better) methods of getting the ip-address? Ojorus
3
4551
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
4134
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 compile the following code I get the this error message: Error 1 'System.Web.HttpRequest.ServerVariables' is a 'property' but is used like a 'method' D:\Projects\sample\comments.aspx.cs 38 78
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8788
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6751
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.