db_update.php 625 B

12345678910111213141516
  1. <?php
  2. include("../functions.php");
  3. $con = startdb("rw");
  4. error_log("IVV update_db starting now");
  5. if (!checkSession($con)){
  6. error_log("Error updating $_GET[table].$_GET[column] : Session has expired.");
  7. http_response_code(403); // Forbidden
  8. exit (-1);
  9. }
  10. else{
  11. if (db_update($con, $_GET["table"], $_GET["column"], $_GET["type"], $_GET["value"], $_GET["id"]) != 0){
  12. error_log("Error updating $_GET[table].$_GET[column] ($_GET[type]) to '$_GET[value] for id $_GET[id]' : Bad request");
  13. http_response_code(400); // Bad request
  14. }
  15. }
  16. ?>