Sending ajax to the same file from which it was sent?

0 like 0 dislike
3 views
Is it possible to send data via ajax form in the same file where the form?
If Yes then how to do it?
Tired for each ajax function to create a separate file.
by | 3 views

1 Answer

0 like 0 dislike
. In the file something like this:
if( (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')){ // ajax request is processed }else{ // display the page }
by

Related questions

110,608 questions
257,186 answers
0 comments
33,770 users