initial commit

This commit is contained in:
Luke Ogburn
2019-03-30 23:03:43 -04:00
commit 3d9e0c7717
29 changed files with 740 additions and 0 deletions

15
write/submit.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
require $root."enc.php";
$enc = encrypt($_POST["words"], $current_key);
$postID = bin2hex(openssl_random_pseudo_bytes(7));
$stmt = $conn->prepare("INSERT INTO posts (id, user_id, text, iv, tag) VALUES (:id, :uid, :txt, :iv, :tag)");
$stmt->bindParam(":id", $postID);
$stmt->bindParam(":uid", $current_userID);
$stmt->bindParam(":txt", $enc[0]);
$stmt->bindParam(":iv", $enc[1]);
$stmt->bindParam(":tag", $enc[2]);
$stmt->execute();
header("Location: /500/read/?post=".$postID);
?>