<?php if (!isset($_POST['data'])) { die; } include_once './TokenCSRF.php'; include_once './Pascal.php'; $tk = new TokenCSRF(); header('Content-type: application/json'); $encodingCode = $tk->getToken('encoding-code'); if (!$encodingCode) { echo json_encode(array('enviado' => TRUE, 'CRFF' => TRUE)); } //btoa(btoa(code + btoa(data))) $data = $_POST['data']; $data1 = base64_decode($data); $data2 = base64_decode($data1); $dataString = base64_decode(str_replace($encodingCode, '', $data2)); parse_str($dataString); //Descarto por ser un bot! if (isset($sex) && $sex !== '') { echo json_encode(array('enviado' => TRUE, 'trucho' => TRUE)); die; } //Descarto por ser un bot! if (!isset($email) && $email === '' || !isset($name) && $name === '') { echo json_encode(array('enviado' => TRUE, 'trucho' => TRUE)); die; } if (!$tk->verifyFormToken('send-score', $code)) { echo json_encode(array('enviado' => TRUE, 'CRFF' => TRUE));
<?php include_once './php/TokenCSRF.php'; include_once './php/Pascal.php'; $tk = new TokenCSRF(); $pg = new Pascal(); ?> <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Navidad en Pascal</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="http://www.pascalgames.com.ar/favicon.ico" /> <link rel="stylesheet" href="css/bootstrap.min.css"> <link href='https://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'> <link href='https://fonts.googleapis.com/css?family=Passion+One:700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"> <link rel="stylesheet" href="css/extCss.min.css"> <script src="js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script> <meta property="og:url" content="http://pascalgames.com.ar" /> <meta property="og:type" content="website" />
<?php include_once './TokenCSRF.php'; include_once './Pascal.php'; header('Content-type: application/json'); $tk = new TokenCSRF(); $token = $_POST['code']; if (!$tk->verifyFormToken('code-fb', $token)) { echo json_encode(array('enviado' => TRUE, 'CRFF' => TRUE)); die; } $id_participante = intval($_POST['idParticipante']); $puntaje = intval($_POST['totalScore']); $pg = new Pascal(); if ($pg->participantShared($id_participante, $puntaje)) { echo json_encode(array('enviado' => TRUE)); } else { echo json_encode(array('enviado' => FALSE, 'DB' => FALSE)); }
<?php include_once './TokenCSRF.php'; include_once './Pascal.php'; header('Content-type: application/json'); $tk = new TokenCSRF(); $token = $_POST['code']; if (!$tk->verifyFormToken('get-ranking', $token)) { echo json_encode(array('enviado' => TRUE, 'CRFF' => TRUE)); die; } $pg = new Pascal(); echo json_encode($pg->getRanking());