// Specify domains from which requests are allowed
header('Access-Control-Allow-Origin: *');
// Specify which request methods are allowed
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
// Additional headers which may be sent along with the CORS request
// The X-Requested-With header allows jQuery requests to go through
header('Access-Control-Allow-Headers: X-Requested-With');
// Set the age to 1 day to improve speed/caching.
header('Access-Control-Max-Age: 86400');
// Exit early so the page isn't fully loaded for options requests
if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') {
exit();
}
// If raw post data, this could be from IE8 XDomainRequest
// Only use this if you want to populate $_POST in all instances
if (isset($HTTP_RAW_POST_DATA)) {
$data = explode('&', $HTTP_RAW_POST_DATA);
foreach ($data as $val) {
if (!empty($val)) {
list($key, $value) = explode('=', $val);
$_POST[$key] = urldecode($value);
}
}
}
/*echo 'Hello CORS, this is '
. $_SERVER['SERVER_NAME'] . PHP_EOL
.'You sent a '.$_SERVER['REQUEST_METHOD'] . ' request.' . PHP_EOL;
*/
?>
Warning: mysqli_connect(): (HY000/2002): No such file or directory in /var/www/myflvs.net/courses/course-modal-2016.php on line 44
Notice: Trying to get property 'connect_errno' of non-object in /var/www/myflvs.net/courses/course-modal-2016.php on line 47
Fatal error: Uncaught Error: Call to a member function query() on bool in /var/www/myflvs.net/courses/course-modal-2016.php:58
Stack trace:
#0 {main}
thrown in /var/www/myflvs.net/courses/course-modal-2016.php on line 58