Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5057 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18937 invoked by uid 1010); 29 Oct 2003 00:20:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 18885 invoked from network); 29 Oct 2003 00:20:40 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 29 Oct 2003 00:20:40 -0000 Received: from lerdorf.com (rasmus@lerdorf.com [66.198.51.121]) by colo.lerdorf.com (8.12.10/8.12.10/Debian-4) with ESMTP id h9T0KZQe012377; Tue, 28 Oct 2003 16:20:35 -0800 Date: Tue, 28 Oct 2003 16:20:35 -0800 (PST) X-X-Sender: rasmus@colo To: Christian Schneider cc: Gareth Ardron , internals@lists.php.net In-Reply-To: <3F9F0529.4020100@cschneid.com> Message-ID: References: <20031028220955.GA569@pulse.oxfordarch.enta.net> <3F9F0529.4020100@cschneid.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on colo Subject: Re: [PHP-DEV] Re: header() behaviour From: rasmus@lerdorf.com (Rasmus Lerdorf) On Wed, 29 Oct 2003, Christian Schneider wrote: > Gareth Ardron wrote: > > $var = "foo=1&bar=2"; > > To clarify: > You should use $var = "foo=1&bar=2"; and then $var for header() but > htmlspecialchar($var) for your href: > - HTTP-Headers must not be html-encoded. > - HTML-Attributes on the other hand have to be html-encoded. > > Even though most browsers work with hrefs without html-encoding and some > browsers might understand & in HTTP-Headers this is not conforming > to the standards. Actually, & is the way you need to write it if you are going to be perfectly standards-compliant. It's just that nobody does this. You can make PHP understand this by setting the separator in your php.ini file to & -Rasmus