Thanks for the reply Dave. I have solved the problem.
For years, using this code in the plugin window, had worked fine for me:
Code:
$var = implode('', file('path/to/this/file/myfile.php1'));
and I then included $var in my template, where I wanted the content of my PHP file to appear.
However, when you try to access the $_SERVER['HTTP_USER_AGENT'] in that PHP file it will return the results of the server's IP rather than that of the client IP.
However, if you use this code for your plugin instead:
Code:
ob_start();
include('path/to/this/file/myfile.php');
$includedphp = ob_get_contents();
ob_end_clean();
$_SERVER['HTTP_USER_AGENT'] will return the user's IP correctly.