who
6-20-05, 02:40 AM
I would like to know if there is any way to get a visitors country (or timezone) into a variable part of a php script. I have seen what "IP2Country" can do, but thats way to much for what I'm going after. Unless powweb could get like a "community database" which would be cool, but I don't think thats in the cards.
so far I have noticed Mozilla tacks some info into userstrings, like en-US for USA, and en-GB for England
so i've cooked this up if(eregi('en-US', $HTTP_USER_AGENT)) {$thistime = date("H")+1;}
if(eregi('en-GB', $HTTP_USER_AGENT)) {$thistime = date("H")+8;}
else {$thistime = date("H");}
echo'"'.$thistime.'" Is this close to your time?'; however it only works with Mozilla, it's a start I guess, unless there is any other way that somone knows of. Any ideas tips, ect. would be greatly appreciated!
so far I have noticed Mozilla tacks some info into userstrings, like en-US for USA, and en-GB for England
so i've cooked this up if(eregi('en-US', $HTTP_USER_AGENT)) {$thistime = date("H")+1;}
if(eregi('en-GB', $HTTP_USER_AGENT)) {$thistime = date("H")+8;}
else {$thistime = date("H");}
echo'"'.$thistime.'" Is this close to your time?'; however it only works with Mozilla, it's a start I guess, unless there is any other way that somone knows of. Any ideas tips, ect. would be greatly appreciated!