Ip Adress

Started on the old forum in September 2007 · view the original in the archive · old links redirect here

12 replies · 987 views · started 19 years ago · 1 min read

4 participants
Guest #1

Hi there coders

Can any one tell me the code to get user ip address?

amylee Principal · 1,092 posts #2
<?php
$ip = getenv('REMOTE_ADDR');
?>

or

<?php
$ip = $_SERVER['REMOTE_ADDR'];
?>

i think

Guest #3

Thanks ....

It work

Regz #5

Oh also pls tell me like if i want to see ip of a particular user how can i do it wid dis code

blackhowk Senior · 411 posts #6

USE THIS:

make the : DATA.txt - change to 777, change wml.php and xhtml.php with your value.

  1. <?php
  2. function add_entry($date,$agent,$accept,$ip,$char,$enc,$lang,$con,$ref,$rem,$port,$url,$fname,$sname ){
  3. $myFile = "DATA.txt";
  4. $fh = fopen($myFile, 'a') or die("can't open file");
  5. $stringData = "$date - | $agent | $accept | $ip | $char | $enc | $lang | $con | $ref | $rem | $port | $port | $url | $fname | $sname |\n" ;
  6. fwrite($fh, $stringData);
  7. fclose($fh);
  8. }
  9. $date = date("| Y-m-d | - | H:i:s |");
  10. $useragent = $_SERVER['HTTP_USER_AGENT'];
  11. $accept = $_SERVER['HTTP_ACCEPT'];
  12. $ip = $_SERVER['SERVER_ADDR'];
  13. $char = (isset($_SERVER['HTTP_ACCEPT_CHARSET']) ? $_SERVER['HTTP_ACCEPT_CHARSET'] : null);
  14. $enc = (isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : null);
  15. $lang = (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null);
  16. $con = (isset($_SERVER['HTTP_CONNECTION']) ? $_SERVER['HTTP_CONNECTION'] : null);
  17. $ref = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null);
  18. $rem = $_SERVER['REMOTE_ADDR'];
  19. $port = $_SERVER['REMOTE_PORT'];
  20. $url = $_SERVER['REQUEST_URI'];
  21. $fname = $_SERVER['SCRIPT_FILENAME'];
  22. $sname = $_SERVER['SCRIPT_NAME'];
  23. add_entry($date,$useragent,$accept,$ip,$char,$enc,$lang,$con,$ref,$rem,$port,$url,$fname,$sname);
  24. $htmlredirect = "xhtml.php";
  25. $wmlredirect = "wml.php";
  26. if(strpos(strtoupper($_SERVER['HTTP_ACCEPT']),"VND.WAP.WML") > 0){
  27. header("Location: ".$wmlredirect);
  28. exit;
  29. }
  30. else
  31. {
  32. header("Location: ".$htmlredirect);
  33. exit;}
  34. ?> edit and capture all about phone, user, etc.
Guest #8

u need a complete user.php for your chat site.. which cn shows ip and browser details?

Guest #9

oh regulus this is for you... total user.php.. when you have free time from chatzone.. upload that to your new chat site.. ok?

Attachments: user.php
Regz #10

I already have this one but thnx

modfiles Developer · 200 posts #11

how bout showing phone number and access point of a user?? i saw a site that display those things.

subzero Super moderator Fellow · 3,954 posts #12

What my SITE PMPL i got that lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #13

oh its my pleasure... its working for old chat scripts...

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close