basic .ajax failure
basic .ajax failure
(still a) newbie here: Stripped all the code out and it still doesn't work. This is so basic that searching around has only found discussion of more complicated problems.
The form alerts, success is called and alerts ("back: ") but no txt and the .php does not open log? If I replace 'url' value with http://mylocalMAMP:8888/test.php the log file is opened but still no data return.
Am I not returning a correct header? Going in circles for a couple hours so any advice/flames/pointers appreciated.
$(document).ready(function(){
$('#bigform').submit(function() {
// alert("form");
var datastring = "dummydata=formvalues";
$.ajax({
type: "POST",
url: "test.php",
dataType: "text",
data: datastring,
success: function(txt){
alert("back: "+txt);
}
});
});
});
------
test.php
<?php
$nm = "log";
$log = fopen($nm, "a");
fwrite($log, "test.php\n");
print "WTF";
?>