Page 1 of 1

No it won't make a cookie if ther is non?

Posted: Fri Aug 30, 2002 3:55 am
by Skywalker
It does not want to make a cookie if ther is no cookie, what am I doing wrong can somebody discribe it?


<?php

$NewNaam=$_POST["NewNaam"];

if (isset($_COOKIE['Naam'])) {
$Naam = "$NewNaam";


} else {

$NewNaam=$_POST["NewNaam"];
setcookie("Naam",$NewNaam,time()+40000,"/test/");
$Naam = "$NewNaam";
}


?>


Thx Skywalker

Posted: Fri Aug 30, 2002 4:12 am
by mikeq
$NewNaam=$_POST["NewNaam"];

if (isset($_COOKIE['Naam'])) {
$Naam = "$NewNaam";
...

Why do you need to set $Naam = "$NewNaam" if the cookie is already set, surely it must contain the correct value in $Naam already?

Posted: Fri Aug 30, 2002 5:22 am
by twigletmac
There is already a thread open with this topic in it, please do not cross-post.

Anybody trying to help could you please post your answer here:
http://www.devnetwork.net/forums/viewtopic.php?t=2650

Mac