I need some PHP code that I can place in any script that will make available as variables the following information:
A variable that reports the domain of the server the script is running on, ie: "[login to view URL]".
I want all "www" and "/[login to view URL]" and "http://" taken out, along with any query strings "?action=1".
The script also needs to be able to gracefully report machines not running as named domains, ie: "localhost" or IP numbers "[login to view URL]" etc.
Must be able to cope with all browsers and operating systems (including contingency measures for pre and post PHP4.2 variables).
This code is going to be used on Win/Nix/MacOSX servers running various different versions of PHP, so this job may not be 100% straight forward and some thought will have to go into the likelyhood of getting back a correct result from environmental variables every time.
This is probably a 15 minute (lunchtime) job for an experienced programmer, please don't bid unless you are very familiar with server and environmental differences and PHP versions etc.
I want it to be watertight and well commented.
The conditions are as follows:
I own the code/scripts after payment. You send me the code/scripts to evaluate on my own server before payment. Payment will not take place until code/scripts are working correctly. Code/scripts should not simply be lifted from some other application. Code/scripts should be submitted in a simgle folder with an HTML files that acts as a working demo of the code/scripts.
Placing a bid implies your acceptance of these conditions.