jxmot / markdown-hitcounter

A simple, yet silent hit counter intended for Markdown files. Its intended use is in README.md files.
MIT License
0 stars 0 forks source link

Does not return error image... #1

Closed jxmot closed 3 years ago

jxmot commented 3 years ago

If the query is missing altogether, there are some instances where appropriate image is not returned.

This bug only appeared when hosting the test hmtl file in XAMPP.

jxmot commented 3 years ago

I beileve it was caused by a difference in the XAMPP version of PHP (5.6) and the hosted version (7.2). The fix was this:

$queries = array();
parse_str($_SERVER['QUERY_STRING'], $queries);
$_id = (isset($queries['id']) ? $queries['id'] : null);