Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with PHP Env Variables

Posted on 2004-03-29
1
Medium Priority
?
1,144 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
[X]
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
1 Comment
 
LVL 6

Accepted Solution

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

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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 …
Suggested Courses

610 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