Call a PHP Script and after that reload
Call a PHP Script and after that reload
Hello,
I need an Ajax Call witch starts an PHP Script. With the PHP Script i like to start an import.
If the import is done i like to reload my datatable (that is allready working).
How can I start the php script and work with parameter from the php-script (true - false)?
buttons: [
{
text: 'Import CSV',
action: function ( e, dt, node, config ) {
// PHP -Script for Import
var success = Call PHP-Script for Import
if (success = true) {
dt.ajax.reload();
}
else {
alert(Import - Error)
}
}
}
Thanks for help!
Thomas
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Why not just use the jQuery AJAX functionality?
I tried it with Jquery AJAX:
But I need the response from the php script. The value or boolean...
You would check the value returned from the PHP script using the jQuery
success
callback. This is the jQuery documentation for its$.ajax
function.Allan
Hello,
i checked the documentation but it doesn't work.
I do not get the response from the php script.
PHP
Where is my mistake?
Thx for your help.
Thomas
You should
echo
the response rather than attempting to return it. You want the PHP script to output the data that the client-side should see.Allan
Hello Allan,
ok. Understand.
Thx a lot...
Thomas