mirror of
https://github.com/pikami/palm-paste.git
synced 2025-12-20 09:19:49 +00:00
People can now view pastes!
This commit is contained in:
6
post.php
6
post.php
@@ -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;
|
||||
?>
|
||||
Reference in New Issue
Block a user