PHP demo

The code is server side.
You cannot "View Source" to see the code.
We show snippets and hints of the code used.



Data PHP code to get data Value
Client IP $_SERVER['REMOTE_ADDR'] 54.92.163.105
Client hostname $_SERVER['REMOTE_HOST']
Client hostname gethostbyaddr ec2-54-92-163-105.compute-1.amazonaws.com
Original IP $_SERVER['HTTP_X_FORWARDED_FOR']
Client browser $_SERVER['HTTP_USER_AGENT'] CCBot/2.0 (https://commoncrawl.org/faq/)
Referring page $_SERVER['HTTP_REFERER']
Server IP $_SERVER['SERVER_ADDR'] 136.206.217.25
Server name $_SERVER['SERVER_NAME'] www.computing.dcu.ie
Server software $_SERVER['SERVER_SOFTWARE'] Apache/2.4.23 (Linux/SUSE)
Server OS php_uname Linux
Server OS PHP_OS Linux ossa2 4.4.120-92.70-default #1 SMP Wed Mar 14 15:59:43 UTC 2018 (52a83de) x86_64



Call command-line

Call command-line to find out who we are running as.
Uses Linux ps to find owner of current process.
 ps -p $$ -o user,ruser 
Output:

 USER     RUSER
wwwrun   wwwrun
 




Test of fetching HTTP page

Using file_get_contents.
(Commented out.)