call from ajax to php in the same file

0

I have two files, one where the ajax code is located and another one where the php is. Can you call from the URL in ajax to the PHP code within the same file? Something like in html:

<?php $_SERVER['PHP_SELF']; ?>

but in ajax

$.ajax({
   url:"codigo php en mismo archivo que codigo ajax" })
    
asked by Johan Solano Contreras 26.08.2018 в 02:20
source

1 answer

0

You can do it not by placing the url field:

$.ajax({
  type: 'POST',
  data: {value: value},
  success: function(e){
    // Código
  }
});
    
answered by 26.08.2018 в 02:42