how to pass input parameters to controlller actions in php mvc with $.get() or $.post() methods ajax jquery? -


how pass input parameters controlller actions in php mvc $.get() or $.post() methods ajax jquery?

in php code how can send $username parameter checkusername action? can send parameter option data parameter in $.get() or $.pos() ajax?

//my class. class users class user extends controller {         // construct class     function __construct()     {         parent::__construct();     }     // action. actin check username in database     public function checkusername($username)     {       // enter code here     }         } 

with post method

function get_username() {     $.ajax({         url:'controller/method',         type: "post",         data: {             'username': username,         },         success: function(data) {         },     }); }   <?php public function checkusername()             {               $username = $_post['username'];                   or               $username = $_get['username'];             } 

change type get method


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -