Добавьте еще одну часть к вашему вызову ajax под названием «data».
<script type="text/javascript">
jQuery(document).ready(function() {
$.ajax("valid.php", {
type: "POST",
dataType: "json",
data: { name: $('#name').val(), email: $('#email').val() },
success: function(step) {
if (step.first) {
alert("fdsgdfg");
}
if (step.second) {
alert("dfgdfg");
}
}
});
});
В качестве альтернативы:
$.ajax({
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});