Solved

Help with PHP Env Variables

Posted on 2004-03-29
1
1,136 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
spacing 5 29
change name file before record in server 5 25
how to us ob_start in a function 11 35
Paging Using PHP 7 32
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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 count occurrences of each item in an array.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now