note 43518 added to function.header

From: Date: Thu, 24 Jun 2004 09:18:07 +0000
Subject: note 43518 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-71569@lists.php.net to get a copy of this message
Is Unicode, UTF-8 and setcookie, session_start at the same time impossible...? Well, then you might need this...: 1) Keep your source files in ASCII to avoid the Byte Order Mark (BOM) confusion hell when include'ing or require'ing multiple files and avoid cookies not working because of the "header already sent" thing.. 2) use this source: --------> <? header('Content-type: text/html; charset=utf-8'); header('Set-Cookie: track=978268624934537'); ?> <html> <head> <meta http-equiv=Content-Type content="text/html; charset=utf-8" /> <-------- Output through Apache to the browser will be UTF-8 and does not require browser to get page twice and the cookie works. Your Chinese or cyrillic characters will work and come on out right too, provided you make an input script to put them into mysql using this scheme too. Seems to me to be the way to use utf-8 with cookies. I hope you like it. Peter Sierst Nielsen ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43518 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43518&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43518&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71569) next »