Re: Getting LABEL for=...



Paul Lautman wrote:

Hi y'all,
is there anyway that I can get the <LABEL for=... data from a form in PHP.

For example, if I have

<label for="name">Full name</label><br>
<input type="text" size="40" name="name" id="name"></p>

Can I get the fact that the label for "name" is "Full name"

TIA
Regards
Paul


Hi Paul,

yes and no.

No: In your current setup you just send the formelements to PHP.
Tip: You can ALWAYS check what PHP receives by printing the $_POST, like
this:

<pre>
<?
print_r($_POST);
?>
</pre>

(The pre's are important, if you don't use them, it will be difficult to
decypher.)

----------------

Yes, by adding extra info to your form, probably with a hidden variable,
like this:
<input type="hidden" name="labelforname" value="Full name">


Regards,
Erwin Moller
.



Relevant Pages

  • Re: Search MySQL db with PHP
    ... check the manual that corresponds to your MySQL ... as well as researching PHP and Googling the error. ... foreach ($params as $param) { ...
    (alt.php)
  • Re: Simple mailling list framework wanted (not email)
    ... The main code I want is the editing and lookup of records as I ... will add the label printing. ... Maybe someone knows of a free PHP framework mailing list application. ...
    (comp.lang.php)
  • Re: goto in php
    ... > Why the heck would you ever need to use goto in php. ... define lbl function ... lbl label() ...
    (alt.php)
  • Re: Help with Visual Studio (beginner)
    ... but not from a form that uses POST method. ... I also come from a PHP background, ... >> the field value on webform2 in a label. ...
    (microsoft.public.dotnet.faqs)
  • Re: IE is not jumping to hash #someanchor in URL
    ... >> I am sure this must be bug in IE6. ... My site is in php too. ... overconfident claim that I made a mistake. ... Erwin Moller ...
    (alt.html)