Hello i would require help with the given script
AJAX
[code] $.ajax({
type: “post”,
url: “http://localhost/raffle.php”,
dataType: “json”,
data: {
“postraffle”: “true”,
“title”: $("#rtitle").val(),
“message”: $("#mess").val(),
“maxentry”: $("#maxentry").val(),
“duration”: $("#durr").val(),
“filter”: $("#reffil").val(),
“split”: $(“input[name=split]:checked”).val(),
“pub”: $(“input[name=rafflepub]:checked”).val(),
“stype”: $(“input[name=stype]:checked”).val(),
“invo”: $(“input[name=invo]:checked”).val(),
“items[]”: itms,
“games[]”: gmes,
},
success: function(data){
if(data.status == “fail”)
{
alert(data.message);
$("#rafBut").removeAttr(“disabled”);
$("#rafBut").attr(“value”, “Raffle it!”);
}
else if(data.status == "ok")
{
window.location.href = "http://localhost/raffle.php";
}
}
});
[/code]
And here is the php script
PHP:
[php]<?php
$data = array(
‘status’ => ‘fail’,
‘message’ => ‘Failed to save data’,
);
echo json_encode($data)[/php];
You can see the script live here admin.tftrg.com/Prototype/raffle.html
I want all of the above data to transmit from HTML using ajax to php
Well currently it shows an error FAILED TO TRANSMIT DATA
Some help would be really appricated
i would like to echo out all the information from ajax to the php script
Thanks!