Created
March 24, 2013 12:16
-
-
Save shantanuo/5231668 to your computer and use it in GitHub Desktop.
Source code of http://saraswaticlasses.net/yubnub/language.html
Translate any word to 5 Indian Languages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language.html | |
<html> | |
<body> | |
<head> | |
<title> Translate any word to 5 Indian languages</title> | |
</head> | |
<form action="welcome.php" method="post"> | |
English Word: <input type="text" name="Eword"> | |
<br> | |
<input type="radio" name="language" value="hi" checked>Hindi | |
<input type="radio" name="language" value="te">Telugu | |
<input type="radio" name="language" value="ta">Tamil | |
<input type="radio" name="language" value="gu">Gujarati | |
<input type="radio" name="language" value="bn">Bengali | |
<p> | |
<input type="submit"> | |
</form> | |
</body> | |
</html> | |
welcome.php | |
<?php | |
if($_POST['language'] == 'hi') | |
{ | |
$uri="http://saraswaticlasses.net/yubnub/scrap.php?trans=".$_POST['Eword']; | |
header("Location: $uri"); | |
} | |
else { | |
$uri="http://saraswaticlasses.net/yubnub/scrap_".$_POST['language'].".php?trans=".$_POST['Eword']; | |
header("Location: $uri"); | |
} | |
?> | |
_____ | |
scrap.php | |
<?php | |
$query=$_GET["trans"]; | |
$data = file_get_contents('https://www.googleapis.com/language/translate/v2?key=your-API-key&target=hi&q='.urlencode($query)); | |
$json = json_decode($data); | |
echo $json->data->translations[0]->translatedText; | |
?> | |
scrap_bn.php | |
<?php | |
$query=$_GET["trans"]; | |
$data = file_get_contents('https://www.googleapis.com/language/translate/v2?key=your-API-key&target=bn&q='.urlencode($query)); | |
$json = json_decode($data); | |
echo $json->data->translations[0]->translatedText; | |
?> | |
scrap_gu.php | |
<?php | |
$query=$_GET["trans"]; | |
$data = file_get_contents('https://www.googleapis.com/language/translate/v2?key=your-API-key&target=gu&q='.urlencode($query)); | |
$json = json_decode($data); | |
echo $json->data->translations[0]->translatedText; | |
?> | |
scrap_ta.php | |
<?php | |
$query=$_GET["trans"]; | |
$data = file_get_contents('https://www.googleapis.com/language/translate/v2?key=your-API-key&target=ta&q='.urlencode($query)); | |
$json = json_decode($data); | |
echo $json->data->translations[0]->translatedText; | |
?> | |
scrap_te.php | |
<?php | |
$query=$_GET["trans"]; | |
$data = file_get_contents('https://www.googleapis.com/language/translate/v2?key=your-API-key&target=te&q='.urlencode($query)); | |
$json = json_decode($data); | |
echo $json->data->translations[0]->translatedText; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment