After processing your Perl/CGI script you may need to redirect it to a specific link. To do this, most of the cases the choice is below code.
But I found that this is not work most of the cases, May be I'm missing something. If anyone know this, can guide me.
But I used to write the below line instead of above one. This one work with me since this is the HTML code printing into browser using Perl.
There is another way to redirect. Which is printing the JavaScript code into browser. I'm giving one example to do this.
By the way, Above will work for Python/CGI too. Appreciate to post other ways if you guys know.
More Perl article is here http://icfun.blogspot.com/search/label/perl
print "Location: http://127.0.0.1/abc.html\n\n";
But I found that this is not work most of the cases, May be I'm missing something. If anyone know this, can guide me.
But I used to write the below line instead of above one. This one work with me since this is the HTML code printing into browser using Perl.
print '<meta http-equiv="refresh" content="0;url=http://127.0.0.1/abc.html">';
There is another way to redirect. Which is printing the JavaScript code into browser. I'm giving one example to do this.
<script type="text/javascript">location.href='http://127.0.0.1/form.html';</script>
By the way, Above will work for Python/CGI too. Appreciate to post other ways if you guys know.
More Perl article is here http://icfun.blogspot.com/search/label/perl
Comments
print "Status: 302 Moved"
print "Location: http://www.somedomain.com/"