minor improvements
This commit is contained in:
parent
be8b5f50f2
commit
9962aff322
10 changed files with 217 additions and 561 deletions
14
action.php
14
action.php
|
@ -42,6 +42,20 @@ switch($_GET["action"]) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case "tinder":
|
||||
if (hasval($_POST["lost"]) && hasval($_POST["found"])) {
|
||||
/* Prepared statement, stage 1: prepare */
|
||||
if (!($stmt = $mysqli->prepare("INSERT INTO matches(l_id, f_id) VALUES (?, ?)"))) {
|
||||
echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error;
|
||||
}
|
||||
if (!$stmt->bind_param("ii", $_POST["lost"], $_POST["found"])) {
|
||||
echo "Binding parameters failed: (" . $stmt->errno . ") " . $stmt->error;
|
||||
}
|
||||
if (!$stmt->execute()) {
|
||||
echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
header('Location: '.$_SERVER['HTTP_REFERER']);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue