Every thing looks great, but when i can change the translation but when i push the save button i get
restricted area.
i have put a username and password in de config.php (the same as the administrator of de wordpress site).
Who can help my.
<?php
require_once 'config.php';
if(!isset($_SERVER['PHP_AUTH_USER']) or !isset($_SERVER['PHP_AUTH_PW']) or !($_SERVER['PHP_AUTH_USER'] == USER and $_SERVER['PHP_AUTH_PW'] == PASS)) {
$file_name = 'cache/' . $_POST['lang'] . '/' . $_POST['md5'];
if(file_exists($file_name)) {
$result = json_decode(file_get_contents($file_name));
$old = isset($result->data->translations[0]->translatedText) ? $result->data->translations[0]->translatedText : null;
$old = isset($result->TranslateResult) ? $result->TranslateResult : $old;
$result->TranslateResult = $_POST['new'];
$result->TranslateResultOld = $old;
unset($result->data->translations[0]->translatedText);
unset($result->data->translations[0]->translatedTextOld);
file_put_contents($file_name.'.human', json_encode($result));
} else {
$result = new stdClass;
$result->TranslateResult = $_POST['new'];
file_put_contents($file_name.'.human', json_encode($result));
}
echo 'success';
exit;
}
#print_r($_POST);
echo 'fail';
Users browsing this forum: No registered users and 5 guests