PHP: how to prevent external malicious submission and call the ajax interface, phpajax. In PHP, how does one prevent external malicious submission and call ajax interfaces? if you use the ajax interfaces written on phpajax's website, define the origin domain name and determine the origin. PHP: how to prevent external malicious submission and call the ajax interface, phpajax
The ajax interface we have written on our own website. if you use it for yourself, you can define the origin domain name and determine the origin.
Note: replace www.jb51.net with your own domain name.
The code is as follows: // determine the origin
If (! Isset ($ _ SERVER ['http _ referer']) |! Stripos ($ _ SERVER ['http _ referer'], 'www .jb51.net ')){
Echo 'canonical' t access ';
Exit ();
}
Articles you may be interested in:
- Methods to prevent repeated ajax requests (GET and POST)
- AJAX prevents repeated request submission.
- Ajax prevents repeated submission of two solutions
- AJAX submits form data for instance analysis
- Solution to prevent repeated Ajax requests
Compile the ajax interface written on our website. if you use it for yourself, define the domain name and determine the path ....