NYCPHP Meetup

NYPHP.org

[nycphp-talk] Form action submission trickery

Cliff Hirsch cliff at pinestream.com
Fri Nov 30 09:54:14 EST 2007


I like to use <form action =²² as a handy (ok, lazy) way to submit to ³self²
and capture the current URI, including query string. It¹s nice to have this
info for later processing for idempotent stuff, redirects, etc.

But, my question ‹ can I count on it?

The W3C says:

action = uri [CT]
    This attribute specifies a form processing agent. User agent behavior
for a value other than an HTTP URI is undefined.

I translate this to mean action = ³² is not recommended, although I have
never experienced a problem in IE or FireFox. From what I have seen, if the
form method is Œget¹, a duplicate value in the query string will be
overridden by the form input element. And for posts, php nicely fills both
the post and get superglobals.

So can I count of this behavior?

Cliff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071130/0605bc83/attachment.html>


More information about the talk mailing list