Gossamer Forum
Home : General : Perl Programming :

Delete With checkbox

Quote Reply
Delete With checkbox
Hello, This is my first time visiting this forum and i have been looking for something like this for a while ! Good job !...
but here is my simple problem...

I am trying to delete given lines in a .txt file and the value of the checkbox's is $FORM{'id'} which is a unique # that i can call the line with..
But when i try and delete the line i only end up with 1 of the lines being erased from the .txt file
I have tried may things dealing with loops but i just can't get them right..

any ideas on how i can delete all the $FORM{'id'} 's selected by the checkbox ?

Drew

[This message has been edited by drew (edited January 20, 1999).]
Quote Reply
Re: Delete With checkbox In reply to
If you are using CGI.pm to parse your form input, it should place all elements checked (or their values) into an array. To delete each line from that text file, you would need to check each element of the array against the Database to delete the separate elements. If you are not using CGI.pm, I strongly suggest doing so, otherwise you'll have a bit more coding on you hands to deal with in your parsing routine.

If you need a specific example on how to do the DB comparision, let me know, I will try to put one together.


------------------
Fred Hirsch
Web Consultant & Programmer