• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP: Help :)

Al Neri

Diamond Member
This place appears to be the best spot on the web to get PHP help, thanks everyone so far 🙂

I'm building a petition script, and I'm making the admin panel right now what it is going to be is [..] is a checkbox

Loop through the DB and output:

[..] Name: $name Comment: $Comment [DELETE]
[..] Name: $name Comment: $Comment [DELETE]
[..] Name: $name Comment: $Comment [DELETE]
etc.
[SUBMIT]

If I tick a checkbox it means I approve a comment; if I don't I don't approve... If I click delete i delete the post...

What naming convention should I use to synch up checkbox and delete with SIGNID (the primary key for an entry into the petition database), I can't seem to figure this out.

Thanks!

Don R.
 
I would name the checkbox something like "comment[123]" where 123 is the ID from the database. Then you just loop through $_POST looking for keys that start with comment and parse out the ID.
 
you can name your checkboxes the same like
<input type=checkbox name=approve[] value=youruniqueid>

Then on your action side, $approve will be an array containing all the unique IDs that you (or the user) checkmarked
 
Back
Top