Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2007, 07:57 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Ip

What is the best function to get a user IP for rating reasons?

Is it Getenv () PHP Function?
__________________
Reply With Quote
  #2  
Old 10-11-2007, 09:39 PM
Lakie is offline Lakie

Join Date: Mar 2002
Posts: 5,540

$_SERVER['REMOTE_ADDR']; holds the IP, below should help woth users on proxies a bit too

PHP Code:
 function GetIP()
    { 
    if(isset(
$_SERVER['HTTP_X_FORWARDED_FOR']))
        
$userIP=$_SERVER['HTTP_X_FORWARDED_FOR'];
    else 
$userIP=$_SERVER['REMOTE_ADDR'];
    return 
trim($userIP);
    } 
Reply With Quote
  #3  
Old 10-11-2007, 10:37 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
sweet. THANKS YOU ROCK!
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IP changes Chrispy Tech Support 3 06-01-2007 07:04 AM
IP Program Rhesha Delta Force 8 03-23-2004 04:34 PM
IP XenoMorpH Web design and Programming 3 08-20-2003 09:54 PM
IP numbers DeDRAGE General Chat 5 03-26-2002 01:12 AM


All times are GMT -5. The time now is 09:38 AM.




Powered by vBulletin®