Run php function inside jQuery click

后端 未结 9 771
醉酒成梦
醉酒成梦 2020-12-03 12:19

How do i run a PHP function inside jQuery click event. I have the following which is not correct. when the user clicks on a button, i want a new directly created.

         


        
9条回答
  •  眼角桃花
    2020-12-03 12:50

    Just do an ajax request and then execute the PHP server side:

    $('button').click(function(){
      $.ajax({url: 'mkdir.php'});
      return false;
    })
    

    and the php:

    
    

    That's all you need.

提交回复
热议问题