Button with cookie and Location

Asked

Viewed 35 times

0

At the beginning of my page includes 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 auto p/next page.

1 answer

0

After some time and imagination I found this from here: I’m going to test....

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.