Jump to content

How to prevent direct access on method?


Go to solution Solved by 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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.