Re: HTTP_POST_VARS: Data there, but can't get to it
| From: | Tom Rogers | Date: | Sun, 11 Nov 2001 03:19:01 +0000 |
| Subject: | Re: HTTP_POST_VARS: Data there, but can't get to it | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74149@lists.php.net to get a copy of this message | ||
Hi
This works (save as whatdo.php)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title>Whatdo</title></head>
<body>
<?php
$rowcount = 2;
$row = 0;
//check for submit button pressed
if($submit == "Submit"):
while($row < $rowcount):
$postvar = "whatdo-".$row;
echo "Row ".$row." is ".$HTTP_POST_VARS["$postvar"]."<br>";
$row++;
endwhile;
else:
?>
<table border="1" cellspacing="0" cellpadding="4">
<form action="whatdo.php" method="post">
<?php
while($row < $rowcount):?>
<tr>
<td>Row <?php echo $row?> Options</td>
<td nowrap>
<input type="radio" name="whatdo-<?php echo $row?>" value="load"checked>Load<br>
<input type="radio" name="whatdo-<?php echo $row?>" value="delete">Delete<br>
<input type="radio" name="whatdo-<?php echo $row?>" value="change">Change Category
</td>
</tr>
<?php
$row ++;
endwhile;
?>
<tr>
<td colspan="2" align="center"><input type="submit" name="submit" value="Submit"></td>
</tr>
</form>
</table>
<?php
endif;
?>
</body>
</html>