Domanda

I am trying to make something like facebook "keep me logged in".I want to use checkbox for storing data, or just to make a code that will check if the checkbox is clicked, and if yes, it should make $remember_me: "true"; and if not $remember_me: "false".
HTML

<input type="checkbox" /> Keep me logged in
È stato utile?

Soluzione

<input type="checkbox" name="remember_me" value="Yes" />

<?php
if (isset($_POST['remember_me'])) {
    $remember_me: "true";
}
else {
    $remember_me: "false"
}

I'd probably recommend not stringing the boolean for true/false

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top