Re: Code problem: Form will only work under GET method

Re: Code problem: Form will only work under GET method

am 20.11.2007 19:23:00 von bruno_guedesav

On 20 nov, 16:04, "Rik Wasmus" wrote:
> On Tue, 20 Nov 2007 12:04:17 +0100, bruno_guedesav
>
>
>
> wrote:
> > On 19 nov, 16:38, "Rik Wasmus" wrote:
> >> On Mon, 19 Nov 2007 19:29:38 +0100, bruno_guedesav
> >> wrote:
> >> > This has ocurred before, but if the person had find a way to solve it
> >> > or not, I've got no clue. So, here I am to ask for help.
>
> >> > I've created a form via pure PHP, basically a bunch of prints together
> >> > making a form. But somthing strange goes on: the form willonlypass
> >> > it's fields forward under methodGET, but not on POST.
>
> >> > Here's a snippet of code, just the basics:
>
> >> I'm not going to check that quote-escape festival just yet. Try to
> >> validate the page it creates with the w3c HTML validator, most likely
> >> you
> >> error will show up there.
>
> >> If after that it still doesn'twork/there are no errors, what form does
> >> your code actually output, and how does your webserver log the request?
>
> > The HTML validator goes fussy on some input tag it claims it's closed
> > but not opened, when it clearily is. Here's the HTML output of the
> > form:
>
> I hate to play validator, I distilled the location of the online form
> though, so let's have a go at submitting the form:
>
> HTTP/1.x 302 Found
> Date: Tue, 20 Nov 2007 17:55:05 GMT
> Server: Apache/2.0.59 (FreeBSD) mod_ssl/2.0.59 OpenSSL/0.9.7e PHP/5.1.4
> Location: http://homepages.dcc.ufmg.br/~guedesav/PbBlog/pages/comment. php?nome=....
> Content-Length: 561
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/html; charset=iso-8859-1
>
> Your site is not at , it's at
> , and as the server is set
> up to do an external redirect, and browsers will NOT post to the 'new'
> page they're redirected to, they'll perform aGET, and POST values will be
> lost.
>
> Either:
> - use the proper host in the url in your form (http://homepages...),
> - use a relative url (action="./pages/comment.php" or
> action="/~guedesav/PbBlog/pages/comment.php"),
> - or configure the server to do this kind of redirects internally instead
> of external.
>
> While the (X)HTML was not the problem it is really in need of cleaning up.
> Not a PHP issue though. ( can never, ever exist in current (X)HTML
> for instance).
> --
> Rik Wasmus

Oh, right, this makes sense, now. Thank you very much for the help,
I'll redefine the address constant, then. Thanks again!