Welcome to CodeCoruses.eu

welcome.jpg

English | Norwegian

Coding Fora logo
  • main_navigation_menu_icon.png
  • Search
  • ic_more_vert.png

How do you display the IP of someone in PHP?

You are here
Fora > How do you display the IP of someone in PHP?

2_180305062105.jpg
sindred

vote_up

0

vote_down

Posted by sindred · 17 April 2019 (183 days ago) · Report · Email

How do you display the IP of someone in PHP?

2 replies


2_180305062105.jpg
Administrator

vote_up

1

vote_down

Posted by Administrator · 17 April 2019 · Report

<?php
$stats_hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$stats_user_agent = $_SERVER['HTTP_USER_AGENT'];
$stats_ip = $_SERVER['REMOTE_ADDR'];
$stats_language = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
$stats_page = $_SERVER['REQUEST_URI'];
$stats_referer_from_url  = $_SERVER['HTTP_REFERER'];
?>

Add a comment

Reply

Social Media

youtube.png