I've got a PHP function that works except it redirects over and over because even though Google loads the website in a framed page, it doesn't give any $_GET or $_POST variables so I can determine whether it has already been redirected or not. Am I making sense? My code below?
Code: Select all
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on")
$pageURL .= "s";
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80")
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
else
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
return $pageURL;
}
if (preg_match('|\.de|', $_SERVER["SERVER_NAME"], $match)) {
header('location: http://translate.google.com/translate?u=' . urlencode(curPageURL()) . '&hl=en&langpair=auto|de&tbb=1&ie=UTF-8');
}I hope this message makes sense...