use strict; use warnings; use Apache::Constants qw(:common REDIRECT); use Apache::Request; # Update. See said it was untested! sub handler { my $r = shift; $r = Apache::Request->instance($r) my $op = $r->param('op'); if (defined $op && $op eq 'vote') { # # Insert code to record votes here # my $node_id = $r->param('node_id') || ''; my $location = "http://" . $r->hostname . "/?node_id=$node_id"; $r->header_out('Location' => $location); return REDIRECT; } # Otherwise carry on and display the page as normal }