22 lines
442 B
PHP
22 lines
442 B
PHP
<?php
|
|
|
|
include "config.php";
|
|
|
|
if ($_GET["text"] === null) {
|
|
exit();
|
|
}
|
|
|
|
$dataArray = array(
|
|
"text" => substr($_GET["text"], 0, $maxQuestionLength),
|
|
"cw" => substr($_GET["cw"], 0, $maxCWLength),
|
|
"iscwed" => !($_GET["cw"] === null || $_GET["cw"] === ""),
|
|
"time" => date("Y-m-d H:i:sP"),
|
|
"ispublic" => $_GET["public"] == 1,
|
|
"isrespondedto" => false
|
|
);
|
|
|
|
pg_insert($db, "data", $dataArray);
|
|
|
|
header("Location: index.php?sent=1");
|
|
|
|
?>
|