Jump to content

see the "name" of an input field


aebstract

Recommended Posts

Don't know how to topic this, but I have an input like this:

<input type=\"text\" name=\"$id$material\" value=\"{$array3['qty']}\" size=\"3\" maxlength=\"3\" />

 

Maybe I should say, several inputs. They each have a unique name as you can see. No two will be the same with this method. Now while I'm running another script after this has been submitted, I'm needing to do something if the name of this input field matches the id/material that I am currently at in my loop. So I need to compare the name before I grab the value. I have no problem grabbing the value of my inputs with a $_POST[$id$material] type of thing.

Link to comment
https://forums.phpfreaks.com/topic/143684-see-the-name-of-an-input-field/
Share on other sites

Would it be:

$postqty = $id2.$material2;

echo "$$_POST[$postqty]";

or

$postqty = $id2.$material2;

echo "$_POST[$$postqty]";

 

The first one doesn't echo anything and the second one produces a white page.

 

 

 

edit: the actual post should be  $_POST['4mild'] or $_POST['8stainless'] something like that, which I'm needing to do a certain task whenever I get to the spot in my loop where idmaterial is = the piece inside that post bracket. Hope this makes sense.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.