Problem is that I can't figure how to identify the post to be deleted via the checkboxes. Should I be thinking line numbers and use seek to excise the selected bits? I tried making the checked value of each button eq $_ (whose value creates the contents of the nested table next to the checkbox, but that made the script go crazy.
Advice on high level logic most welcome, I'm not asking for a code handout, but maybe a map on a cocktail napkin?
TIA
jg
_____________________________________________________#!/usr/bin/perl -w use strict; use CGI; use CGI ':standard'; use CGI::Carp qw/fatalsToBrowser /; my $q = CGI->new(); my $path_to_text="/home/nolaflash/www/exp/news/body.txt"; my $post_number; print header; #only just beginning to work out using standard print "<HTML><BODY><center>"; print "<form method=post action=http://www.nolaflash.com/cgi-bin/editi +ngscript.pl>\n"; print "<TABLE width=600>"; print "<TR bgcolor=#000066><TD colspan=2 align=center><font color=#ff +ffff>"; print "<h2>Edit Your Posts</h2></font></TD>"; open (FH, "$path_to_text") or die "where's the damn file? : $!"; $/="\n\n"; #set the input Record seperator to + a double newline while (<FH>) { next if /^\n+$/; #ignore lines which contains only +newlines $post_number++; print "<TR><TD valign=top>Delete This Post?<input type=checkbox name +=box$post_number value=onepost> </TD>\n"; print "<TD><table width=295><TR><TD>$_\n"; #print the textblock in +a nested table with an ... print "</TD></TR></TABLE></TD></TR>\n"; print "<TR bgcolor=#000066><TD colspan=2> </TD>"; #appending +darkline print "</TR>\n"; } close FH; print "<TR bgcolor=#333333><TD align=center colspan=2><input type=subm +it name=Submit value=\"Delete Checked Posts\"></TD>"; print "</form></center></table></body></html>"; exit;
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |