Re: [PHP] Perhaps an incomplete $_POST



To the best of my knowledge, the "name" attribute of the FORM tag is
never submitted with the request, whether it be GET or POST. It's
there for client-side scripting (JavaScript, etc.) only.

One trick that might help you - if your form action is POST, add a
querystring to the action, something like "foo.php?formname=foo", then
check $_GET['formname']. Of course, it might be just as easy to drop
in a hidden input instead.

Hope this helps.

On 8/29/07, Jay Blanchard <jblanchard@xxxxxxxxxx> wrote:
I just noticed something a little odd, and maybe there is a simple
solution. Given a form;

<form name="foo" action="foo.php" method="POST">

The attributes, especially the name "foo", never appear in any variables
array. I am thinking that this might be handy to have for several
reasons when processing the form. I have several reasons for needing the
information, does anyone know how to get this in the processing script
without having to add hidden fields or do some Ajax magic?
.



Relevant Pages

  • Re: [PHP] Perhaps an incomplete $_POST
    ... One trick that might help you - if your form action is POST, ... in a hidden input instead. ... I have several reasons for needing the ... does anyone know how to get this in the processing script ...
    (php.general)
  • Perhaps an incomplete $_POST
    ... I just noticed something a little odd, and maybe there is a simple ... The attributes, especially the name "foo", never appear in any variables ... I have several reasons for needing the ... does anyone know how to get this in the processing script ...
    (php.general)
  • Re: Question about forms
    ... > The problem is that the delete buttons do not work since the form action is ... > always triggered for the submit button, as its form tags are nested within ... Your processing script will only receive the value of ONE submit button. ... Some variation on this theme is what I am hinting at. ...
    (alt.php)