{"id":190,"date":"2013-10-03T12:04:32","date_gmt":"2013-10-03T10:04:32","guid":{"rendered":"http:\/\/www.marranzano.com\/wordpress\/?p=190"},"modified":"2013-10-03T12:05:06","modified_gmt":"2013-10-03T10:05:06","slug":"aggiungere-il-ricordami-in-un-form-php","status":"publish","type":"post","link":"https:\/\/www.marranzano.com\/wordpress\/aggiungere-il-ricordami-in-un-form-php\/","title":{"rendered":"Aggiungere il Ricordami in un form php"},"content":{"rendered":"<p>Come aggiungere un pulsante &#8220;Ricordami&#8221; in un form php<\/p>\n<p>Il form \u00e8 composto da 2 file, uno con il form e l&#8217;altro con le istruzioni del form.<\/p>\n<p>Per comodit\u00e0 spiego la funzione valida per un campo, se serve su pi\u00f9 campi basta replicare dove serve.<\/p>\n<p>1-<br \/>\nNel file del form inserire il checkbox del ricordami:<\/p>\n<div>\n<div style=\"padding-left: 30px;\"><code>&lt;input type=<\/code><code>\"checkbox\"<\/code> <code>name=<\/code><code>\"Rem\"<\/code> <code>\/&gt;Ricordami <!--more--><br \/>\n<\/code><\/div>\n<div>2-<br \/>\nNel file delle istruzioni posizionare il cookie<\/div>\n<blockquote>\n<div>\n<div>\n<div><code>&lt; ?php <\/code><\/div>\n<div><code>if(isset($_POST[<\/code><code>'Rem'<\/code><code>]))<\/code><\/div>\n<div><code>\u00a0<\/code><code>{<\/code><\/div>\n<div><code>\u00a0<\/code><code>setcookie(<\/code><code>'remember'<\/code><code>,$_POST[<\/code><code>'user'<\/code><code>],time() +<\/code><code>60<\/code><code>*<\/code><code>60<\/code><code>*<\/code><code>24<\/code><code>*<\/code><code>30<\/code><code>);<\/code><\/div>\n<div><code>\u00a0<\/code><code>}<\/code><\/div>\n<div><code>?&gt;<\/code><\/div>\n<\/div>\n<\/div>\n<\/blockquote>\n<div>\n<div>\n<div>3-<br \/>\nNel file del form al posto dell&#8217;input normale<\/div>\n<blockquote>\n<div>\n<div>\n<div><code>&lt; ?php<\/code><\/div>\n<div><code>if(isset($_COOKIE[<\/code><code>'remember'<\/code><code>]))<\/code><\/div>\n<div><code>\u00a0<\/code><code>{<\/code><\/div>\n<div><code>\u00a0<\/code><code>echo <\/code><code>\"&lt;input name =\\\"user\\\" type=\\\"text\\\" id=\\\"user\\\" value=\"<\/code><code>.$_COOKIE[<\/code><code>'remember'<\/code><code>].<\/code><code>\"\/&gt;\"<\/code><code>;<\/code><\/div>\n<div>\u00a0<code> <\/code><code>}<\/code><\/div>\n<div>else<\/div>\n<div>\n<div><code>\u00a0<\/code><code>{<\/code><\/div>\n<\/div>\n<div>\n<div><code>\u00a0<\/code><code>echo <\/code><code>\"&lt;input name =\\\"user\\\" type=\\\"text\\\" id=\\\"user\\\" value=\"<\/code><code>.$_COOKIE[<\/code><code>'remember'<\/code><code>].<\/code><code>\"\/&gt;\"<\/code><code>;<\/code><\/div>\n<div>\u00a0<code> <\/code><code>}<\/code><\/div>\n<\/div>\n<div><code>?&gt;<\/code><\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Come aggiungere un pulsante &#8220;Ricordami&#8221; in un form php Il form \u00e8 composto da 2 file, uno con il form e l&#8217;altro con le istruzioni del form. Per comodit\u00e0 spiego la funzione valida per un campo, se serve su pi\u00f9 campi basta replicare dove serve. 1- Nel file del form inserire il checkbox del ricordami: &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.marranzano.com\/wordpress\/aggiungere-il-ricordami-in-un-form-php\/\" class=\"more-link\">Leggi tutto<span class=\"screen-reader-text\"> &#8220;Aggiungere il Ricordami in un form php&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,11],"tags":[],"class_list":["post-190","post","type-post","status-publish","format-standard","hentry","category-web","category-oscommerce"],"_links":{"self":[{"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/posts\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/comments?post=190"}],"version-history":[{"count":3,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/posts\/190\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/posts\/190\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/media?parent=190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/categories?post=190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marranzano.com\/wordpress\/wp-json\/wp\/v2\/tags?post=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}