Hi,
I realy need some help with the use of cookies.
It seems i can't get the cookie to be set properly.
I have the following file called form.php:
<?php
setcookie ("testvalue" , "$value" , time()+864000);
?>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="form.php">
<input type="text" name="value" value="<? echo $testvalue; ?>">
<input type="submit" name="Submit" value="Submit">
</form>
</body>
I want to be able to enter a value in the form's textfield and store it in the cookie.
So if i close the window and open an new one with the file form.php loaded. I expect the value i entered the previous run, to be printed in the form's text field.
I found out that when i submit the form twice the inputted value is printed in the textfield. so it looks like the testvalue variabele is saved somehow. (altough i don't see a new cookie in the cookie dir)
But when i go to another page and then again go to form.php, the inputted value is gone again.
It's probably something very simple, but i can't figure it out.
Thanks in advance