function translate_entries( $form ) {
$apiKey = '';
$text = $_POST['input_24_6'];
$url = 'https://www.googleapis.com/language/translate/v2?key=' . $apiKey . '&q=' . rawurlencode($text) . '&target=en';
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($handle);
$responseDecoded = json_decode($response, true);
$responseCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); //Here we fetch the HTTP response code
curl_close($handle);
if($responseCode != 200) {
$_POST['input_24_6'] = $responseDecoded['error']['errors'][0]['message'];
}
else {
$_POST['input_24_6'] = $responseDecoded['data']['translations'][0]['translatedText'];
}
}
my question is for the address the variable is _POST ['input_24_6'] is it correct? or should it be so? _POST [‘input_24’] [6]