Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

onclick call php function with parameters

<input type='button' name='Release' onclick="downloadFichier(param1, param2)" value='Click to Release'>
<script>
  function downloadFichier(param1, param2){

        $.ajax({
            type: 'POST',
            url: 'file_product.php',
            data: "param1=" + param1 + "&param2=" + param2,
            success: function(data) {
                $("p").text(data);
            }
        });
</script>
 
PREVIOUS NEXT
Tagged: #onclick #call #php #function #parameters
ADD COMMENT
Topic
Name
8+1 =