Help with form action code

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Can anyone describe what the following form action code means:

<form action="?formsubmit=1" method="post">

I'm not familiar with the "?formsubmit=1" portion of the code. This is
contained in a website I will be inheriting. As the form in context
does not appear to work (it simply redisplays the form page without
any indication of success or failure). As I have found other instances
of incorrect or deprecated tag structures elsewhere in the website,
I'm not sure how much credence to give this syntax. At best I assume
some script name is intended to appear immediately before the question
mark with the following as a parameter. Is this analysis correct, or
am I unaware of something?

Re: Help with form action code

And lo, Michael didst speak in alt.www.webmaster:

Quoted text here. Click to load it

The action attribute of the form describes the URI to which the form  =

contents will be submitted.  In this case, the URI is a relative one whi=
ch  =

begins with the query string.  Essentially it means: "submit the form to=

the current URI, but tack on '?formsubmit=3D1' to the end of it"

Thus if the URI of the form is, then the form  =

will be submitted, via the POST method, to  =

This is a sneaky way of submitting both POST and GET variables at the sa=
me  =

time.  In PHP, this means that the REQUEST_METHOD will be set to POST, b=
ut  =

the GET variable "formsubmit" will be set to 1.

Quoted text here. Click to load it

There is nothing wrong with the form code.  It is likely the server-side=

code which accepts the form input is not recognizing that the form has  =

been submitted.

Quoted text here. Click to load it

It is nothing so complex.  It is simply the query string end of a relati=
ve  =



-- =

The technical axiom that nothing is impossible sinisterly implies the  =

pitfall corollary that nothing is ridiculous.
- - Orca Search: Full-featured  =

spider and site-search engine

Re: Help with form action code


Quoted text here. Click to load it

... (snip)

Quoted text here. Click to load it

Thanks for the succinct and prompt reply. Now I know why it was in a
.php file without a single instance of PHP code. I also think I know
why the previous webmaster is running away and I'm inheriting the
site. I guess he didn't know what the next step is :) (Of course, as
of this morning, I didn't either.)

-- Michael

Site Timeline