Jump to content

How to prevent direct access on method?


lilmer

Recommended Posts

I'm using a method  call from ajax. But how do I prevent the method not to be access directly?

I try.

 if(isset($_POST)){

 } else{
  die('Unauthorize page!'); 
}

but  still i can be access directly. What is the safest way to prevent it accessing directly?

 

Link to comment
https://forums.phpfreaks.com/topic/283679-how-to-prevent-direct-access-on-method/
Share on other sites

not to mention the fact that anybody can fake that header easy enough. Like I said:
 

The short answer is there is no absolute 100% way to prevent it.

But there are some tricks to help weed out some of the bots and noobs. Google "ajax obfuscation" and feel free to post any specific questions.

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.