qna/send.php

36 lines
No EOL
555 B
PHP

<?php
include 'config.php';
if ($_GET["text"] === null) {
exit();
}
if ($_GET["cw"] === null || $_GET["cw"] === "") {
$iscw = False;
} else {
$iscw = True;
}
if ($_GET["public"] == 1) {
$isPublic = True;
} else {
$isPublic = False;
}
$curTime = date("Y-m-d H:i:sP");
$dataArray = array(
"text" => $_GET["text"],
"cw" => $_GET["cw"],
"iscwed" => $iscw,
"time" => $curTime,
"ispublic" => $isPublic,
"isrespondedto" => False
);
pg_insert($db, "data", $dataArray);
header("Location: index.php?sent=1");
?>