Advertisement
Guest User

submit.php

a guest
Sep 7th, 2013
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (isset($_POST['submit'])){
  4.         $keyID = $_POST['inputKeyID'];
  5.         $vCode = $_POST['inputVerification'];
  6.  
  7.         //...
  8.         //validate $keyID and $vCode, make sure it's all good. Set $valid_data to true if it's valid, false if not
  9.         //...
  10.  
  11.         if ($valid_data) {
  12.             //data was valid, redirect to display.php
  13.             $_SESSION['keyID'] = $keyID;
  14.             $_SESSION['vCode'] = $vCode;
  15.             header('Location: display.php');
  16.         } else {
  17.             //it wasn't valid, redirect back to the form page
  18.             $_SESSION['error'] = "Your Key ID and Verification are invalid";
  19.             header('Location: index.php');
  20.         }
  21. } else {
  22.     // no form data, redirect to index.php
  23.     $_SESSION['error'] = "Please provide Key ID and verification";
  24.     header('Location: index.php');
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement