Created
September 30, 2015 11:49
-
-
Save madmis/313f99b45b23b506a6e6 to your computer and use it in GitHub Desktop.
PHP 7 fastcgi_finish_request - test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$requestType = $_SERVER['HTTP_X_REQUESTED_WITH'] ?? 'not ajax'; | |
$html = <<<EOL | |
<html> | |
<!-- BEGIN HEAD --> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="robots" content="noindex, nofollow" /> | |
<title>HUB - Client List</title> | |
<script src="//code.jquery.com/jquery-2.1.4.js"></script> | |
</head> | |
<body> | |
<strong>$requestType</strong> | |
<script> | |
$(function() { | |
$.get('index.php?test=test'); | |
}); | |
$(function() { | |
setTimeout(function() { | |
// $.get('index.php?test=test'); | |
}, 500); | |
setTimeout(function() { | |
// $.get('index.php?test=test'); | |
}, 1500); | |
}); | |
</script> | |
</body> | |
</html> | |
EOL; | |
if (!isset($_GET['test'])) { | |
echo $html; | |
var_dump($_SERVER); | |
} else { | |
echo json_encode(['data' => 'any data']); | |
} | |
fastcgi_finish_request(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment