Harden index-ajax.php