Button with cookie and location

0

At the top of my page is the cookie:

<?php setcookie("agenda","2016");?>

At the bottom of the page, without using form, I have the following button:

<button class="button button1" onclick="location.href='escolha_sala.php?inst=Manaus';">Manaus</button>

How do I go to the next page escolha_sala.php but send the data inst=Manaus pro cookie using this button and without using form?

I want to choose one of the buttons, click on it, save the corresponding data in the cookie and go automatic to the next page.

    
asked by anonymous 10.04.2016 / 19:45

1 answer

0

After some time and imagination I found it from here: I'll be testing ....

<?php setcookie("agenda","2016"); function button() { setcookie("inst","Manaus"); } if (isset($_GET['hello'])) { button(); } ?>

    
10.04.2016 / 19:56