Re: cookies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



if(isset($_COOKIE))
{
    $var = $_COOKIE['name'];
    print($var);  // prints blah
}
setcookie("name","blah",time() + 24 * 60 * 60);
?>
<form action="" name="myform" method="post">
<input type="text" name="txt" id="txt" value="fernando" />
<input type="submit" formmethod="post" />
</form>

Em seg., 10 de ago. de 2020 às 06:44, Fernando Fiore <no5software@xxxxxxxxx> escreveu:
//i want to display the value of the field txt in my form
<?php
if(isset($_COOKIE)){
  print($_COOKIE['name']);
}

setcookie("name","myform[txt]",time() + 24 * 60 * 60);

?>
<form action="" name="myform" method="post">
<input type="text" name="txt" id="txt" />
<input type="submit" formmethod="post" />
</form>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux