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

Your name:

Reply:


Posted by Rik Wasmus on 11/20/07 18:04

On Tue, 20 Nov 2007 12:04:17 +0100, bruno_guedesav =

<bruno_guedesav@yahoo.com.br> wrote:
> On 19 nov, 16:38, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Mon, 19 Nov 2007 19:29:38 +0100, bruno_guedesav
>> <bruno_guede...@yahoo.com.br> 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 toget=
her
>> > making a form. But somthing strange goes on: the form will only pas=
s
>> > it's fields forward under method GET, 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't work/there are no errors, what form do=
es
>> your code actually output, and how does your webserver log the reques=
t?
>
> 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=3De=
tc.etc.etc.
Content-Length: 561
Keep-Alive: timeout=3D15, max=3D100
Connection: Keep-Alive
Content-Type: text/html; charset=3Diso-8859-1

Your site is not at <http://www.dcc.ufmg.br/~guedesav/PbBlog/>, it's at =
=

<http://homepages.dcc.ufmg.br/~guedesav/PbBlog/>, and as the server is s=
et =

up to do an external redirect, and browsers will NOT post to the 'new' =

page they're redirected to, they'll perform a GET, and POST values will =
be =

lost.

Either:
- use the proper host in the url in your form (http://homepages...),
- use a relative url (action=3D"./pages/comment.php" or =

action=3D"/~guedesav/PbBlog/pages/comment.php"),
- or configure the server to do this kind of redirects internally instea=
d =

of external.

While the (X)HTML was not the problem it is really in need of cleaning u=
p. =

Not a PHP issue though. (</input> can never, ever exist in current (X)HT=
ML =

for instance).
-- =

Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация