SHARE
TWEET

action.php

michussj07 Dec 28th, 2018 (edited) 7 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * Created by PhpStorm.
  4.  * User: MichaƂ
  5.  * Date: 2018-12-28
  6.  * Time: 18:02
  7.  */
  8.  
  9. if(isset($_POST['token'])) {
  10.     require 'DbConnect.php';
  11.     $db = new DbConnect;
  12.     $conn = $db->connect();
  13.     $cdate = date('Y-m-d');
  14.     $stmt = $conn->prepare('INSERT INTO tokens VALUES(null, :token, :cdate)');
  15.     $stmt->bindParam(':token', $_POST['token']);
  16.     $stmt->bindParam(':cdate',$cdate);
  17.     if($stmt->execute()) {
  18.         echo 'Token Saved...';
  19.     } else {
  20.         echo 'Failed to saved token...';
  21.     }
  22. }
  23.  
  24. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top