mirror of
https://github.com/pikami/palm-paste.git
synced 2025-12-19 08:49:49 +00:00
Pastes now get an unique text id and can only be accessed by it
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<?php
|
||||
if(isset($id)){
|
||||
if(isset($uid)){
|
||||
include "config/config.php";
|
||||
$stmt = $conn->query('SELECT * FROM pastes WHERE id='.$id);
|
||||
$result = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
echo "<h1>".$result["title"]."</h1>";
|
||||
echo "<textarea class=\"form-control\" rows=\"5\" disabled=\"true\">".$result["text"]."</textarea>";
|
||||
$stmt = $conn->query('SELECT * FROM pastes WHERE uid="'.$uid.'"');
|
||||
if($result = $stmt->fetch(PDO::FETCH_ASSOC)){
|
||||
echo "<h1>".$result["title"]."</h1>";
|
||||
echo "<textarea class=\"form-control\" rows=\"5\" disabled=\"true\">".$result["text"]."</textarea>";
|
||||
}
|
||||
else echo "Paste does not exist";
|
||||
} else echo "Error: id not set";
|
||||
?>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user