stash
This commit is contained in:
parent
943d209fd3
commit
acec8b1120
6 changed files with 75 additions and 23 deletions
29
ajax.php
29
ajax.php
|
@ -4,4 +4,31 @@
|
|||
* User: jedi
|
||||
* Date: 12/28/18
|
||||
* Time: 6:13 PM
|
||||
*/
|
||||
*/
|
||||
|
||||
include "backend.php";
|
||||
|
||||
function hasval($var){
|
||||
return isset($var) && !empty($var);
|
||||
}
|
||||
|
||||
switch($_GET["action"]) {
|
||||
case "add_featurerequest":
|
||||
if (hasval($_POST["title"]) && hasval($_POST["desc"])) {
|
||||
/* Prepared statement, stage 1: prepare */
|
||||
if (!($stmt = $mysqli->prepare("INSERT INTO feature_request(title, desc) VALUES (?, ?)"))) {
|
||||
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
|
||||
}
|
||||
if (!$stmt->bind_param("sss", $_POST["was"], $_POST["wann"], $_POST["wo"])) {
|
||||
echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
|
||||
}
|
||||
if (!$stmt->execute()) {
|
||||
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
echo json_encode(array("get"=>$_GET,"post"=>$_POST));
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue