For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > August 2004 > Webpage response to selection & $_POST









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Webpage response to selection & $_POST
Philip Thompson

2004-08-29, 8:55 pm

Hi all.

I have a list of users in a database that I would like to show on a
dynamic webpage. With each of these users that shows up on the page,
there is going to be a checkbox next to their name so that I can
perform multiple tasks, such as 'Remove User' or 'Modify Information'.
I have all of the appropriate information showing up on the page,
including the checkboxes.

My question is... if I select a checkbox for a user, the other pages do
not even recognize that I have selected that checkbox and I am using
the $_POST method - why is that? I have even attempted to use the
import_request_variables function - no luck. So, I cannot verify which
users I want to perform an action on.

Anyone have any ideas? Snippets of code to follow...

Thanks in advance,
~Philip


<form action="performaction.php" method="post">
<table>
<?php
for ($j=0; $j<$numRows; $j++) {
echo '<tr>' . "\n";
echo ' <td><input type="checkbox" name="user' . $j . '"
value="1"></td>' . "\n";
echo ' <td>' . $dbid[$j] . '</td>' . "\n";
echo ' <td>' . $firstName[$j] . '</td>' . "\n";
echo ' <td>' . $lastName[$j] . '</td>' . "\n";
echo ' <td>' . $uid[$j] . '</td>' . "\n";
echo ' <td>' . $username[$j] . '</td>' . "\n";
echo ' <td>' . $classification[$j] . '</td>' . "\n";
echo ' </tr>' . "\n";
}
?>
</table>

<input type="submit" name="removeuser" value="Remove User" />
<input type="submit" name="modifyclass" value="Modify Classification" />
<input type="hidden" name="beenSubmitted" value="1" />
</form>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com