This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

submit.php

By: a guest on Sep 7th, 2013  |  syntax: PHP  |  size: 0.86 KB  |  views: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>
clone this paste RAW Paste Data