intranetman has asked for the wisdom of the Perl Monks concerning the following question:
$future[$n] = "<tr><td><form method=post> <input type=hidden name=confname value=\'$firstName\'> <input type=hidden name=starttime value=\'$lastName\'> <input type=hidden name=endtime value=\'$start_date\'> <input type=hidden name=reservee value=\'$end_date\'> <input type=submit value=delete></td><td><center>$firstName $lastName</center><td><center>$email</center><td><center>$voicemail</c +enter><td><center>$start_date2</center><td><center>$end_date2</center +></form></tr>"; print qq~<h3 align=center>Future Out of Office List </h3>~; print qq~<br><br>~; print qq~The following will be out of the office until the date specified:~; print qq~<br><br><br>~; print qq~<TABLE border="2" align="center"><tr><th><th>Employee<th>Checking E-mail<th>Checking Voicemail<th>Leaving<th>Returning~; for($i = 0; $i < @future; $i++) { print qq~$future[$i]~; } print qq~</TABLE>~; }
However, nothing is ever deleted and the information still all the information appears on the screen. I've ensured that the date formats are the same as well as user ids, lastnames, firstnames, etc. I know I could do a join and maybe only use a delete statement, but that's for future improvements.if($session_cgi->param("delete")) { $firstName = $session_cgi->param("firstName"); $lastName = $session_cgi->param("lastName"); $startdate = $session_cgi->param("start_date"); $enddate = $session_cgi->param("end_date"); $db = dbLoad($db); $select_statement = "SELECT id FROM Employees WHERE lastName = '$lastName' and firstName = '$firstName'"; $select_it = $db->prepare($select_statement); $rc = $select_it->execute() or die "Could not run query '$select_statement'\n"; $select_it->bind_columns(undef, \$user_id); $select_it->fetchrow_arrayref(); $statement = "DELETE FROM Out_Of_Office WHERE id = '$user_id' and start_date = '$start_date' and end_date = '$end_date'"; $statement = $db->prepare($statement); $rv = $statement->execute() or die "Couldn't execute query '$query' \n"; $db->disconnect();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Form not parsing correctly
by Zaxo (Archbishop) on Apr 26, 2005 at 21:44 UTC | |
by intranetman (Acolyte) on Apr 27, 2005 at 16:21 UTC | |
|
Re: Form not parsing correctly
by trammell (Priest) on Apr 26, 2005 at 21:59 UTC | |
by Kevad (Scribe) on Apr 27, 2005 at 02:32 UTC | |
by intranetman (Acolyte) on Apr 27, 2005 at 15:53 UTC |