require_once 'data/functions.php';
$response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6LeesRIUAAAAAIWSXLB-QYDGuxOnxH__4ON5W5IG&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
if (($response['success']==true)) {
if (isset($_POST["do_action"]) && ($_POST["do_action"] == "add_parere")) {
query("INSERT INTO $table_pareri (`nume`, `email`, `text`, `activ`, `data_adaugare`)
VALUES
(
'" . stripToAllowedChars($_POST["name"]) . "',
'" . stripToAllowedChars($_POST["email"]) . "',
'" . stripToAllowedChars($_POST["message"]) . "',
'Nu',
NOW()
)");
$id = mysql_insert_id();
$message .= "
A fost adaugata o noua parere pe tu.ro ce necesita aprobare:
Nume: " . stripToAllowedChars($_POST["name"]) . "
Email: " . stripToAllowedChars($_POST["email"]) . "
Mesaj:
" . stripToAllowedChars($_POST["message"]) . "
";
$message .= 'Pentru a modifica/aproba parerea, mergi la https://www.tu.ro/admin/pareri_edit.php?id=' . $id . '
';
$message .= 'Poti vizualiza toate parerile pe: https://www.tu.ro/admin/pareri.php
';
sendmail($email_admin, 'Parere adaugata pe tu.ro', $message);
mail_digest("Parere adaugata pe tu.ro.\n\n $message");
$mesaj = "Am adaugat parerea si va trebui aprobata.";
}
}
elseif (strlen($_POST["message"])>2) $mesaj="Va rugam sa completati Capcha-ul.";
print_header(lg("Pareri"), '', true, '100%');
print_title(lg("Pareri"), '', false, '100%');
?>
' . $parere["nume"] . (($parere["data_adaugare"] != "0000-00-00 00:00:00") ? ' (' . substr($parere["data_adaugare"], 0, 10) . ')' : '') . '
Nici o parere