CODE
<?php print $_SERVER['USER_AGENT']; ?>
Means to OUTPUT the visitor's browser.
CODE
<?php print $_SERVER['REMOTE_ADDR']; ?>
Means to OUTPUT the visitor's IP address.
CODE
<?php print $_SERVER['SERVER_NAME']; ?>
Means to OUTPUT the current server.
CODE
<?php print $_SERVER['DOCUMENT_ROOT']; ?>
Menas to OUTPUT the current location where the PHP script is located.
How to apply:
Create a PHP script with any file name.
CODE
<html>
<head>
<title>Sample PHP Script</title>
</head>
<body>
<div align="center" style="font-size: 11px; font-family: verdana; color: black;">
Hello! Welcome to website.com!
Your current browser is: <strong><?php print $_SERVER['USER_AGENT']; ?></strong><br>
Your IP address is: <strong><?php print $_SERVER['REMOTE_ADDR']; ?></strong><br><br>
This script is located at <strong><?php print $_SERVER['DOCUMENT_ROOT']; ?></strong> on <strong><?php print $_SERVER['SERVER_NAME']; ?></strong><br><br>
<strong>If you try to hack my site, I'll know who you are!</strong>
</div>
</body>
</html>
<head>
<title>Sample PHP Script</title>
</head>
<body>
<div align="center" style="font-size: 11px; font-family: verdana; color: black;">
Hello! Welcome to website.com!
Your current browser is: <strong><?php print $_SERVER['USER_AGENT']; ?></strong><br>
Your IP address is: <strong><?php print $_SERVER['REMOTE_ADDR']; ?></strong><br><br>
This script is located at <strong><?php print $_SERVER['DOCUMENT_ROOT']; ?></strong> on <strong><?php print $_SERVER['SERVER_NAME']; ?></strong><br><br>
<strong>If you try to hack my site, I'll know who you are!</strong>
</div>
</body>
</html>
There. It's finish. What do you think?


