Jump to content

PHP Security that allows AJAX to access


Axcelcius

Recommended Posts

I have two files. index.html and system_check.php. I was using the following code to prevent hackers from accessing system_check.php directly. The problem is that it also prevents index.html from accessing that file.

 

<?php
//Protects from Unauthorized Access
if(eregi("system_check.php", $_SERVER['PHP_SELF'])) die("Hacking Attempt");
?>

 

Is there an alternate way of denying direct access to system_check.php but will allow index.html to access it?

Link to comment
https://forums.phpfreaks.com/topic/75554-php-security-that-allows-ajax-to-access/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.