I'm trying to write a dropdown form with a submit button that uses Google translation to translate the current page that I'm on. Here's what I currently have (someone helped me with this):
<form action="http://www.google.com/translate_c" method="get">
<input type="hidden" name="hl" value="en" />
<input type="hidden" name="u" value="<?php echo curPageURL(); ?>" />
<select name="langpair">
<option value="en%7Cafr">English to Afrikaans</option>
<option value="en%7Calb">English to Albanian</option>
...
</select>
<input type="submit" value="Submit" />
</form>
(Echo calls the URL of the current page:)
<?php
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;
}
?>
Why does Google think I'm trying to translate from English to English with this code?