Exemplo n.º 1
0
<?php 
include_once 'includes/connection.php';
?>

<?php 
//Start the session
session_start();
//Require the class
require 'formkey.class.php';
//Start the class
$formKey = new formKey();
$error = 'No error';
//Is request?
if ($_SERVER['REQUEST_METHOD'] == 'post') {
    //Validate the form key
    if (!isset($_POST['form_key']) || !$formKey->validate()) {
        //Form key is invalid, show an error
        $error = 'Form key error!';
    } else {
        //Do the rest of your validation here
        $error = 'No form key error!';
    }
}
?>


   <!-- Title Block -->
   <section class="hero">
      <div class="overlay">
         <div class="row intro"></div>
      </div>
Exemplo n.º 2
0
         }
         if (isset($_REQUEST['id_tipo'])) {
             $data['id_tipo'] = trim($_REQUEST['id_tipo']);
         }
         if (isset($_FILES["user_img"]['name']) && $_FILES['user_img']['name'] != "") {
             $file = $_FILES["user_img"];
         } else {
             $file = null;
         }
         $usersc = new usersc();
         $usersc->crear_user($data, $file);
     }
 }
 if ($_REQUEST['func'] == 4) {
     $formKey = new formKey();
     if (!isset($_REQUEST['form_key']) || !$formKey->validate($_REQUEST['form_key'])) {
         echo 5;
     } else {
         if ($_REQUEST['email_old'] == $_REQUEST['email']) {
             $switch = true;
         } else {
             $switch = false;
         }
         $usersc = new usersc();
         $data = array();
         if (isset($_REQUEST['f_name'])) {
             $data['f_name'] = trim($_REQUEST['f_name']);
         }
         if (isset($_REQUEST['l_name'])) {
             $data['l_name'] = trim($_REQUEST['l_name']);
         }