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!
I'm in my first few days of PHP/MySQL, and I'm trying to perform multiple actions upon checkboxes being activated for multiple records. I've reviewed severla tutorials, but my needs are more complex than what I've found.
I have a loop which displays the records called by my query plus the following checkbox fields to the side:
<form action="adminvalidate.php" method="POST">
// later on in my code...
//toggle photo variable
print ("<td align=center><input name=\"togglephoto\" type=\"checkbox\" value=\"$listingID\"></td>");
//remove listing
print ("<td align=center><input name=\"removelisting\" type=\"checkbox\" value=\"$listingID\"></td>");
//further on...
</form>
<input type="submit" name="Submit" value="Update All Ads">
I'm kind of in over my head, and I don't know how to pass these events (of someone checking the boxes) on to the next page and then updating the database for all records on the previous page with the checkbox info.
Sorry for being such a newb, but allow me try a different approach here.
I have a page that executes a SELECT query and displays the results in a nice, pretty table. For each row/record, I have a checkbox that I would like to program to pass on the record number into an array if it is checked.
So here are the steps the user will perform:
1) Load the page
2) View query results (the number displayed I have no control of)
3) Check certain checkboxes (if any)
4) Click submit
Then I just want a list of the records where the checkbox was checked passed onto the next page as an array.
Sorry for being a total newb about this, but I'm trying to be as basic as I can to get this done.
So essentially to get this all done, I just need to define the names with some reference to the record in question, and use an loop with those record numbers, to retrieve the appropriate post variables on the next page?