Icedz Posted March 25, 2008 Share Posted March 25, 2008 I'm putting together a site where users can upload pictures. Each picture that gets uploaded is going to be verified by an admin. The pictures will be uploaded, but will have a flag of "not_activated" in a database. Let's say one day I get 100 pictures uploaded. How can I approve multiple at one time? For example, have a page come up with x at a time (I can do that), with either a check box or radio buttons approving or not approving the pics. Thanks! Link to comment https://forums.phpfreaks.com/topic/97731-approving-multiple-pictures/ Share on other sites More sharing options...
pocobueno1388 Posted March 25, 2008 Share Posted March 25, 2008 Name each checkbox something like "approve[]" and make the value the Images ID from the DB. EX. <input type="checkbox" name="approve[]" value="{$row['images_ID']}"> Then at the top of the script put this code: <?php if (isset($_POST['your_submit_button'])){ if (!empty($_POST['approve'])){ foreach ($_POST['approve'] as $imageID){ $imageID = (int)$imageID; $query = mysql_query("UPDATE image_table SET approved='yes' WHERE imageID=$imageID")or die(mysql_error()); } } echo "Images Approved"; } ?> Obviously change the queries to match your database. Link to comment https://forums.phpfreaks.com/topic/97731-approving-multiple-pictures/#findComment-500101 Share on other sites More sharing options...
Icedz Posted March 25, 2008 Author Share Posted March 25, 2008 w00t! thanks! I was on the right track. That makes me feel good at least Link to comment https://forums.phpfreaks.com/topic/97731-approving-multiple-pictures/#findComment-500107 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.