note 61384 added to function.setcookie

From: Date: Thu, 02 Feb 2006 02:49:13 +0000
Subject: note 61384 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-102852@lists.php.net to get a copy of this message
I spent some time solving this one. If you save your php script as UTF-8 output will start at line 1 (script tag start) and setcookie() will fail. If you save the page as ANSI setcookie() will work properly. I've encountered this problem before. If anyone gets a "Headers already sent" error, check the encoding of your script page. Although I wish it were different, UTF-8 encoded scripts start output at the php tag declaration. ---- Server IP: 210.138.109.182 Probable Submitter: 203.140.174.32 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61384 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61384&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61384&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102852) next »