Php 4 Deleteing Cookies: Trying to set and delete a cookie in same page
| From: | John Weez | Date: | Thu, 06 Jun 2002 23:55:31 +0000 |
| Subject: | Php 4 Deleteing Cookies: Trying to set and delete a cookie in same page | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-101042@lists.php.net to get a copy of this message | ||
Hi all.
I'm trying to delte a cookie and then set it to a new value in a php page. The problem is that once the cookie is set. PHP will not delete it.
I use PhP 4. Here is the code...The pgp file name is testcookie.php...so the page goes back to itself again..i'm testing to see my code was allowing me to update the cookie to new values...etc...any ideas???
<?php
setcookie("username","");
setcookie("username",$username);
?>
<HTML>
<BODY>
<FORM NAME="FORM" ACTION="./testcookie.php">
Your name:<INPUT TYPE="TEXT" NAME="username">
<INPUT TYPE="submit" NAME="submit" value="submit"
</FORM>
</BODY>
</HTML>