i’ve a PHP function like this:
function setUser()
{
$userName=$_POST['userName'];
$userSurname=$_POST['userSurname'];
//code...
}
I call this function with an address like: ?index.php&module=registration
So, how do i call with jquery $_GET[‘module’] to recall the setUser(); function and to pass it all POST parameters that i need? Can you please make me an example?
Thanks and sorry for my bad english!
that would be a simple jquery script to post the data. Presumably you will be grabbing the values of the post parameters dynamically from some page fields and feed it to the post function (something like
$("#name").val()). More info at http://api.jquery.com/jQuery.post/I also added the click event, because most likely you will have this attached to a button, which when clicked will post the data (if you are using submit button you will have to uncomment the preventDefault line).