D
D
Dom Alfro2020-01-29 11:57:55
css
Dom Alfro, 2020-01-29 11:57:55

How to make it work first popup ( js ) and then php?

Good day !
I would like to know how to implement such a thing - so that:
let's say I click on a button and I don't want the php script to be executed immediately - but only if I have an option in js - for example: do you want to exit? ( yes ) - php script is being executed ( no ) php script is not being executed. I still can't figure out how to connect.
I hope my question is clear!
Thank you very much !

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Maslov, 2019-05-04
@vladimir328

A
Andrey Lamzin, 2020-01-29
@mustang_shelby

Need javascript.
For your example (e.g. logging out via /logout link)

if ( confirm('Вы хотите выйти?') ) {
    location.href = '/logout';
}

And under the link /logout there is a php script that logs out.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question