call php program from html using parameters code example
Example 1: set php var to html
<?php ob_start();?>
<div>Contents goes <b>here</b></div>
<?php $contents=ob_get_clean();?>
Example 2: javascript call php function with parameters
var deleteClient = function(id) {
$.ajax({
url: 'path/to/php/file',
type: 'POST',
data: {id:id},
success: function(data) {
console.log(data); // Inspect this in your console
}
});
};
Example 3: PHP Variables
<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>