Activating TOAST messages via _POST / _GET (mdl)

31 views Asked by At

After successful or unsuccessful execution of a PHP script, i want to display the execution result on the site in the form of a pop-up notification. How can I do this better? Let's say I pass the result via _GET or _POST Is it possible to use a toast for this, something like:

if (isset $_POST['message']) {
$message = $_POST['message'];
showmessage("$message");
}

I know that in PHP there is no such thing as ShowMessage, but I’m not very strong in JS.

1

There are 1 answers

0
Tha_slughy On BEST ANSWER

Use php to echo out a script block:

if (isset($_POST['message'])) {
    echo "<script type=\"text/javascript\">alert('SUCCES!');</script>"; 
   exit;
}