You can't access this file directly! redirecting to home page now.";
?>
exit;}
function translate($text,$lang1,$lang2){
$query = "js=n&prev=_t&hl=en&ie=UTF-8&text=$text&file=&sl=$lang1&tl=$lang2";
$ch=curl_init();
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, "http://translate.google.com/?");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
curl_setopt($ch, CURLOPT_ENCODING , "UTF-8");
$output = curl_exec($ch);
// echo $output;
curl_close($ch);
if ($lang2=="ar" || $lang2=="iw") {
$body = getstring($output, "overflow:auto\">", "");
if ($body==""){
$body = getstring($output, "'#fff'\">", "");
}
$prefix="
";
$body=$prefix.$body;
return $body;
//return $output;
}
if ($lang2=="fr") {
$body = getstring($output, "overflow:auto\">", "");
if ($body==""){
$body = getstring($output, "'#fff'\">", "");
}
$prefix="
";
$body=$prefix.$body;
//return $output;
$body = str_replace(''', "'", $body);
return str_replace("é", "é", $body);
}
else {
$body = getstring($output, "overflow:auto\">", "");
if ($body==""){
$body = getstring($output, "'#fff'\">", "");
}
$prefix="
";
$body=$prefix.$body;
return str_replace("é", "é", $body);
//return $output;
}
}
?>