Selaa lähdekoodia

Added primitive ajax.php for testing

Foppe Hemminga 6 vuotta sitten
vanhempi
commit
bbbd124374
1 muutettua tiedostoa jossa 3 lisäystä ja 4 poistoa
  1. 3 4
      ajax.php

+ 3 - 4
ajax.php

@@ -1,21 +1,20 @@
 <?php
 
 if (is_ajax()) {
-	// if (isset($_POST["venue"]) && !empty($_POST["venue"])) { //Checks if action value exists
+	if (isset($_GET["venue"]) && !empty($_GET["venue"])) { //Checks if action value exists
 		// $action = $_POST["action"];
 		// switch ($action) { //Switch case for value of action
 		//	case "test":
 				test_function();
 		//		break;
 		//}
-	// }
+	}
 }
 
 //Function to check if the request is an AJAX request
 function is_ajax()
 {
-	return True;
-	// return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
+	return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
 }
 
 function test_function()