Нет описания

deleteQuestionnaireExperience.php 1.0KB

123456789101112131415161718192021222324252627282930
  1. <!---
  2. Developer: Coralys Cubero Rivera
  3. Fall 2018
  4. This script deletes an association between a questionnaire and an experience, then returns
  5. the user to the experiences main page.
  6. Updated by: Víctor A. Hernández
  7. Summer 2019
  8. --->
  9. <?php
  10. require_once 'processes/config.php';
  11. require_once 'processes/dbh.inc.php';
  12. // IF USER ENTERS PAGE AFTER YES BUTTON HAS BEEN PRESSED (FROM confirmDeleteQuestionnaireExperience.php), DISASSOCIATE QUESTIONNAIRE FROM EXPERIENCE IN THE DATABASE
  13. // ELSE DO NOTHING
  14. if(isset($_GET['del']) AND isset($_GET['exp'])) {
  15. $query = "DELETE FROM `experience_questionnair` WHERE `id_questionnair`='".$_GET['del']."' AND `id_experience`='".$_GET['exp']."';";
  16. if(!mysqli_query($connection, $query)) die("Error: ".mysqli_error($connection));
  17. // WHY NOT USE header INSTEAD OF window.top.location?
  18. //header('Location: http://emaapp.online/admin_nuevo/viewExperience.php?view='.$_GET['exp']);
  19. //exit();
  20. echo "<script>window.top.location='http://emaapp.online/admin_nuevo/viewExperience.php?view=".$_GET['exp']."'</script>";
  21. }