Re: [PHP] header() not working?

[email protected] (Ryan Pallas)
Newsgroups php.general
Message-ID <CAObuZdsmh2YfA-VXvA4_7cZeRBRNX4_2UBBHexHVkOx=V8nkPg@mail.gmail.com>
On Sat, Dec 10, 2016 at 8:22 AM, Tedd Sperling <[email protected]> wrote:

>
> > On Dec 8, 2016, at 1:05 PM, Christoph M. Becker <[email protected]>
> wrote:
> >
> > On 08.12.2016 at 18:53, Ryan Pallas wrote:
> >
> >> On Thu, Dec 8, 2016 at 10:40 AM, Christoph M. Becker <[email protected]
> >
> >> wrote:
> >>
> >>> On 08.12.2016 at 17:30, Tedd Sperling wrote:
> >>>
> >>>> For several years I have had an example of a redirect working on my
> >>> college’s Server for my students to review.
> >>>>
> >>>> The code is simple:
> >>>>
> >>>> header ("Location:$where");
> >>>> exit(0);
> >>>>
> >>>> -snip-
> >
> > Good catch!  Note, however, that RFC 7231 which obsoletes RFC 2616 has
> > relaxed this:
> >
> >  Location = URI-reference
> >
> > Still, `amazon.com` would not be valid according to the spec.
> >
> > Cheers,
> > Christoph
> >
> >> [1] - https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
> >> [2] - https://www.w3.org/Protocols/HTTP/1.0/spec.html#URI
>
> Thanks.
>
> Good consideration, but that’s not the problem.
>
> Here’s the URL and code, try it yourself:
>
> http://citw.lcc.edu/~sperlt/citw185/examples/redirect.php


You have output before header call. If you turned on error_reporting ike
Chris mentioned, you would see that output had already started.
Specifically this line is output:

print_r($_POST);



>
>
> Cheers,
>
> tedd
>
> _______________
> tedd sperling
> [email protected]
>
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.