14 lines
351 B
PHP
14 lines
351 B
PHP
<?php
|
|
if (empty($_POST) || !isset($_POST['submit'])) {
|
|
die("Post canceled: no post / no submit");
|
|
}
|
|
|
|
require_once('inc/database.php');
|
|
$db = new DataBase();
|
|
$userid = $db->getAuthedUserId();
|
|
$persid = $_POST['persona']; // TODO: CHECK OWNERSHIP! (db schema?)
|
|
if($userid) {
|
|
$db->addPost($_POST['text'], $userid, $persid);
|
|
}
|
|
header("Location: /");
|
|
?>
|