Jump to content

$var = $_POST['var']


porta325

Recommended Posts

I have several generated textboxes. Each has a name like text1, text2, text3 and text4

 

After i post them to next page all i get is the last value.

So the solution would be to write them manualy as:

$text1 = $_POST['text1'];

$text2 = $_POST['text2'];

$text3 = $_POST['text3'];

$text4 = $_POST['text4'];

 

or

 

to do something like

$id1 = "1";

$id2 = "2";

$id3 = "3";

$id4 = "4";

and use

$text.$id1 = $_POST['text$id1'];

$text.$id2 = $_POST['text$id2'];

.... and so on. The id's i take from a database using a while loop, it's just to make the example clear.

Link to comment
https://forums.phpfreaks.com/topic/100772-var-_postvar/#findComment-515403
Share on other sites

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.