php delete confirm box

Associate
Joined
18 Oct 2002
Posts
344
I have a table containing a triplist, which basically i want to be able to remove people from using a delete button. to avoid CSRF attacks i gather the best thing is to send the values to delete.php using a form.

so at the moment, for each of the rows i have:
Code:
echo "\t\t<form method=\"post\" action=\"del.php\">\n";
echo "\t\t<input type=\"hidden\" name=\"token\" value=\"$token\" />\n";
echo "\t\t<input type=\"hidden\" name=\"user_id\" value=\"".$user_id."\"/>\n";
echo "\t\t<input type=\"submit\" value=\"remove\" name=\"del\" />\n";
echo "\t\t</form>\n";

The trouble is, with ~100 users this makes an unneccessarily large and slow page with all that for every row.

Im wondering if theres any way of maknig a confirmation box which then generates that code for the relevant user and submits it.

Maybe a javascript box which when ok is clicked will POST the values to del.php?

I know i can do it in a seperate page, but what about a facebook style thing?

thanks :D
 
indeed. so i guess one giant form with a text box next to each person and then a "submit" button at the bottom to delete them?

It all works perfectly at the mo, just seems like a long way round having 100 forms on the page :confused:
 
Back
Top Bottom