<input type="hidden" name="step" value="<? echo($step); ?>">
<input type="submit" id="btn" value="увеличить">
$step=$_POST['step'];//шаг
$step++;
$(function(){
$('#btn').click(function(){
var step = $('input[name=step]').val();
$.ajax({
url: 'obrabot.php',
type: 'POST',
data: {'step':step,},
success: function(data) {
alert(data);
}
});
});
});
alert(step);
<?php
$a=$_POST['param'];
$a++;
echo $a;
?>
<!DOCTYPE html>
<input type="button" id="magicbtn" />
<div id="magichtml"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).on("click", "#magicbtn", function() {
$.ajax({
url: "magic.php"
}).done(function(result) {
$( "#magichtml").html(result);
});
});
</script>
<?php
echo $_REQUEST["param"]
?>
<!DOCTYPE html>
<input type="button" id="magicbtn" />
<div id="magichtml"></div>
<script src="http://code.jquery.com/jquery-latest.js">
$(document).on("click", "#magicbtn", function() {
$.ajax({
url: "magic.php",
data: {param:value}
})
.done(function(result) {
$( "#magichtml").html(result);
});
});
</script>