Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Help with PHP Env Variables

Posted on 2004-03-29
1
1,138 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
How to obtain the string from a PHP StdObject ? 6 32
Ajax php search with multiple text fields generated by php 38 62
Wordpress Query 5 24
PHP 5.6 and 7.x 4 18
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

789 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