What is the best way to just run a PHP script when the user clicks a button? It sends nothing back to the user whatsoever! (The PHP script only sends a PostgreSQL query.)
I have only found ways of returning data. I only want to run it.
You're looking for AJAX (asynchronous javascript). Just have a javascript function call the target script and either don't return anything OR don't do anything with the return value. Alternately, you could simply have form that submits to a hidden iframe on the page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With