If I print the header() first, then I end up with the 'redirect()' code being printed to the browser. So this is not what I have been doing.
But I think I might have a clue, tell me if I am right. The CGI is being called form an HTML Form that uses Post, After processing the info, I use redirect(). Do you think the clients browser goes and Posts the form again to the new URL? If this is what is happening, is the solution to use: print "Location: $url\n\n"; with-out printing any headers? Will this work for all browsers? Thanks Jonathan > A common mistake is to print a header and then do a redirect, which slows > the process down because essentially you have a script and a page competing > to generate a header. When using redirect(), do not do this: > > #!/usr/bin/perl > use CGI; > my $q = new CGI; > print $q->header(); # don't need this if redirecting! > print $q->redirect('http://www.whatever.com'); > > > Do this instead: > > #!/usr/bin/perl > use CGI; > my $q = new CGI; > print $q->redirect('http://www.whatever.com'); > > > Or another option: > > #!/usr/bin/perl > my $url = 'http://whatever.com'; > print "Location: $url\n\n"; > > > HTH, > > Scot R. > inSite > > ___________________________ > > > After complaints that my CGI takes too long, I traced it down to the > redirect() function. > Why does it take so long? > Is there an alternative? > > Jonathan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]