Textbox value

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Textbox value

Post by S_henry »

In page A, i have use textbox to dispay list of records using loop (for). I named that textbox 'txtStudent<?php echo $i ?>' with variable $i is the index (get the value from looping). After I've puts the value into all of the textbox, i post(submit) that page A to page B. The problem is, in page B, I don't know how to retrieve the value of the textbox (txtStudent<?php echo $i ?>). Can anybody help me pls..thanx.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

Code: Select all

<?php

$i = 0;
while (isset($_POST&#1111;'txtStudent' . $i])) &#123;
    echo $_POST&#1111;'txtStudent' . $i];
    $i++;
&#125;

?>
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Post by S_henry »

OK. Thanx rehfeld for your help. :D
Post Reply