Solved

Help with PHP Env Variables

Posted on 2004-03-29
1
1,140 Views
Last Modified: 2008-02-26
Hi, I'm trying to write a page that logs user details such as the user's IP address and so on. When I try to output an environment vairable to the screen (to test the page), nothing gets printed out. I have tried various combinations such as:
echo $REMOTE_ADDR;
echo getenv("REMOTE_ADDR");
echo $_ENV['REMOTE_ADDR'];
print "Addr: $REMOTE_ADDR";
And so on. These variables are displayed when i call the phpinfo() method from my page. I tried using ASP to output the variables, and that seems to work fine. I'd rather use PHP tho, so if anyone can help, that'd be great! :)
Cheers,
Darren.
0
Comment
Question by:led_zephrylin
1 Comment
 
LVL 6

Accepted Solution

by:
jkna_gunn earned 50 total points
ID: 10711604
print $_SERVER["REMOTE_ADDR"];
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question