Alex Piotto
09-17-2002, 04:13 PM
Hi people!
This is my first post in the cgi forum...
I use to work with PHP, but I really need to finish an old perl job.
I have a script that receive the action command from a previous page/script and then delete data in a simple db.
I need to add a confirmation box to warning the users they are actually deleting an item... how can I do this?
I am trying to insert some javascript inside the cgi code, but it is not working... :(
Here is the part of the code where I need the confimation box
______________________________________
if ($input{'action'} eq 'delete'){
//confirm: delete or not? If not, go back, if yes, do the following:
open (DATABASE,">$database");
@DB=<DATABASE>;
foreach $rec (@ODB){
chomp($rec);
($titulo,$itemtime,$texto,$obs)=split(/\|/,$rec);
if ($titulo eq $input{'titulo'} && $itemtime eq $input{'itemtime'} && $texto eq $input{'texto'} && $obs eq $input{'obs'}){
print DATABASE "";
}else{
print DATABASE "$titulo|$itemtime|$texto|$obs\n";
}
}
close (DATABASE);
}
_______________________________________
Any help will be very very very very welcome!
Alex :)
This is my first post in the cgi forum...
I use to work with PHP, but I really need to finish an old perl job.
I have a script that receive the action command from a previous page/script and then delete data in a simple db.
I need to add a confirmation box to warning the users they are actually deleting an item... how can I do this?
I am trying to insert some javascript inside the cgi code, but it is not working... :(
Here is the part of the code where I need the confimation box
______________________________________
if ($input{'action'} eq 'delete'){
//confirm: delete or not? If not, go back, if yes, do the following:
open (DATABASE,">$database");
@DB=<DATABASE>;
foreach $rec (@ODB){
chomp($rec);
($titulo,$itemtime,$texto,$obs)=split(/\|/,$rec);
if ($titulo eq $input{'titulo'} && $itemtime eq $input{'itemtime'} && $texto eq $input{'texto'} && $obs eq $input{'obs'}){
print DATABASE "";
}else{
print DATABASE "$titulo|$itemtime|$texto|$obs\n";
}
}
close (DATABASE);
}
_______________________________________
Any help will be very very very very welcome!
Alex :)