note 8028 deleted from function.setcookie by rasmus

From: Date: Sat, 10 Aug 2002 14:27:34 +0000
Subject: note 8028 deleted from function.setcookie by rasmus
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-34697@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!');&lt;? cookiestring('Loaded','Yes',3600); ?>">

« previous php.notes (#34697) next »