How can I know when going to a predetermined url


Good evening I have a program that generates a button to pay. But I need to know when the payment is canceled. and when it's done.

Now I'm testing and place that when you cancel go to google .. but I want to know how I take a variable that confirms when I cancel and another when I pay.

                                                  Be an active member          

Is that they are "hidden" type and I do not understand them well ... I want to know that when you click here

There is a way to know it.

and when from here

<input type="hidden" name="cancel_url" value="">

there is also a way to know it through PHP.

I hope you help me please.

asked by yi amor 08.12.2018 в 05:47

1 answer


have you not thought about taking name as a variable from javascript?

you could do something like this:

var name=document.getElementById("d").name;

and you could do something like this:

    document.onclick = function(event) {
        event = event || window.event; // IE specials
 var name=document.getElementById("pagar").name;
        if(name=== "pagar") {
            alert('fue un pago');
        } else{


I explain my code:


first I create a function to take a onclick then I get   the ID or Name of the element (that's already your decision) then I see if the   selected item is pay if it is pay send a message that is   pay and if it is not ps send another message saying that it is not payment.

that code believes it reading your question I hope it serves you.

pst no testier

answered by 08.12.2018 в 07:17