Glad it's working now! :) I assume you took out the first "print $query->header( -cookie=>$cookie );" to fix it? I think you can also safely remove the "-type => 'text/html'," part from the second one. You're not actually outputting any HTML, just redirecting.