note 8028 added to setcookie

From: Date: Thu, 24 Aug 2000 14:15:48 +0000
Subject: note 8028 added to setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-3079@lists.php.net to get a copy of this message
Also had problems with setcookie under php 3.0.9. Explorerr 5.00 didn't get it, Netscapee 4.74 did. I couldn't found the problem. But i made a half workaround. It is half, because it's only working with JavaScript 1.0 compatible browsers. But you can send it anywhere in your html (yeah, even <IMG onmousedown> works: picture sending cookies 8D ). It is pretty simple, I don't know why I am barking so much, you can delete it. The code is here: function CookieString($Name,$Value,$Expdate) { echo('document.cookie=\''.$Name.'='.$Value.';'); if ($Expdate) { echo('Expire='.date('l, d-M-y H:i:s',time()+$Expdate).'\';'); } else { echo('\';'); } } I hope spec chars go througth well. Example: <body onload="alert('Loaded!');<? cookiestring('Loaded','Yes',3600); ?>"> http://www.php.net/manual/function.setcookie.php

« previous php.notes (#3079) next »