to move to another .php page by clicking a button with cookies

<?php # check cookie if(isset($_COOKIE['userid']) && userLogin($_COOKIE['userid'])) { # get first name and last from database $fullname = $row['firstname'].' '.$row['lastname']; } ?> myEncryption Dashboard

Hi, <?php echo $row['username'] . "what do you want to do now?"; ?>

i want a page(keygen.php) to be opened, when the button ( value=“Generate key(s)”) in above html code is pressed
and also plz let me know if i have used cookies correct in this page or not? as i want the variables from the index.php (previous page) in this page also

thanks
:slight_smile:

If you’re not passing any variables then why not use a link and style it to look like a button?
Otherwise use the onClick event

<button onclick="window.location='keygen.php'">Generate Key(s)</button>

If you are passing variables you’ll need to make it a form instead of using just submit.

Sponsor our Newsletter | Privacy Policy | Terms of Service