您好,我想在从数据库中删除数据后重定向到另一个位置。但它向我显示以下错误:状态:302 找到位置:
my $q= new CGI;
print $q->header ('Text/html');
print $q-> start_html(
-title => "",
);
my $db = "peroples";
my $user = "root";
my $pass = "";
my $host="127.0.0.1";
my $dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pass);
my $action_delete = $q->param('delete');
my $action_update = $q->param('update');
if($action_delete + 0 > 0) {
my $row_id = $action_delete + 0;
my $sqlQuery = $dbh->prepare("DELETE FROM peoples WHERE ID = $row_id");
$sqlQuery->execute;
print $q->redirect(-uri => 'http://localhost/cgi-bin/peoples.pl',);