 |
Results from the most recent live auction are here.
22 members in the live chat room. Join Chat!
| |
03-04-2006, 01:38 PM
|
· #1 | | NamePros Regular Location: At Home Join Date: Sep 2005
Posts: 806
NP$: 981.10 ( Donate)
| Getting current user's IP address While looking in the PHP predefined variables i found an intersting one: $_ENV["REMOTE_ADDR"]. what this does is it gives the current IP of the person viewing your site. This is quite good if you are making a poll for a intranet where each user has their own username.
Have a look at this and tell me what you think. PHP Code: <?php
$ip = $_ENV["REMOTE_ADDR"]; //set variable
echo $ip; //show the value of the variable
?>
I hope somebody finds it helpful.
ASGSOFT |
| |
03-06-2006, 04:10 AM
|
· #2 | | Account Closed Name: Christian Eklund Location: ../home/mysite Join Date: Dec 2005
Posts: 3,613
NP$: 3.00 ( Donate)
| If you search for it on google you would easily find it, but thnx anyway. |
| |
03-09-2006, 10:58 AM
|
· #3 | | BlahBlahBlah... Name: Navjot Singh Location: India Join Date: Oct 2005
Posts: 1,941
NP$: 0.51 ( Donate)
| Thanks for the information...I was looking for such a info to be used with a Quiz PHP Script! |
| |
03-14-2006, 07:44 AM
|
· #4 | | NamePros Regular Location: Canada Join Date: Sep 2005
Posts: 674
NP$: 597.25 ( Donate)
| I personally uses JS for that  But I guess PHP overcomes it in simplicity |
| |
03-14-2006, 08:01 AM
|
· #5 | | NamePros Auctioneer™ Name: Bill Location: New Jersey Join Date: Feb 2005
Posts: 11,915
NP$: 1825.51 ( Donate)
| You can also display the users IP to them. An example of this can be found at www.cat5.us |
| |
03-15-2006, 03:58 AM
|
· #6 | | NamePros Regular Name: Jamie Location: Clevedon, UK Join Date: Oct 2005
Posts: 198
NP$: 25.00 ( Donate)
| Thanks may come in handy.. |
| |
03-18-2006, 01:11 PM
|
· #7 | | NamePros Member Join Date: Oct 2005
Posts: 191
NP$: 3097.00 ( Donate)
| Slightly different method, same info: Code: <?php
echo "<html><head><title>lifted from www.scanmybrowser.com</title></head>";
echo "<body><h1>A few request header variables:</h1>";
echo "HTTP_REFERER=".getenv("HTTP_REFERER")."<br>";
echo "REMOTE_ADDR=".getenv("REMOTE_ADDR")."<br>";
echo "HTTP_USER_AGENT=".getenv("HTTP_USER_AGENT")."<br>";
echo "HTTP_ACCEPT=".getenv("HTTP_ACCEPT")."<br>";
echo "HTTP_ACCEPT_LANGUAGE=".getenv("HTTP_ACCEPT_LANGUAGE")."<br>";
echo "HTTP_ACCEPT_CHARSET=".getenv("HTTP_ACCEPT_CHARSET")."<br>";
echo "HTTP_ACCEPT_ENCODING=".getenv("HTTP_ACCEPT_ENCODING")."<br>";
echo "</body></html>";
?>
Similar examples in ASP and C++ at www.scanmybrowser.com - look for the links in the left navbar. |
| |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |