People can now view pastes!

This commit is contained in:
pikami
2016-06-09 09:02:09 +00:00
parent d1019f8df6
commit 31ae9de368
2 changed files with 16 additions and 3 deletions

View File

@@ -1,10 +1,8 @@
<?php
include "config/config.php";
if(isset($_POST["type"])){
echo "TYPE!";
//===New_Paste===//
if($_POST["type"]=="paste" && isset($_POST["text"])){
echo "TEXT!";
/* Set paste details */
$title = "Untitled";
$text = $_POST["text"];
@@ -16,9 +14,11 @@ if(isset($_POST["type"])){
$stmt->bindParam(':tit', $title);
$stmt->bindParam(':txt', $text);
$stmt->execute();
$id = $conn->lastInsertId();
$conn = null; //close connection to database
header("Location: ".$id);
die();
}
}
echo "FIN!";
$conn = null;
?>