2014-04-08 25 views
0

我从HTML文件(index.html)中调用一个perl脚本。HTML与Perl脚本不返回到主页

<form method="post" action="cgi-bin/test.pl"> 
    more cmds.... 
    <input type="submit" align="left" value="Submit"> 
</form> 

perl脚本执行成功。但它仍然在test.pl。它不返回到index.html。在perl脚本之后还有更多的操作需要完成。

如何将执行指针返回到index.html

+0

你的脚本应该重定向到HTML页面(由JavaScript /头/ meta标签)重定向。顺便说一下,这是一个古老的方法,甚至在上个世纪末期就已经超过了整个CGI波。 –

回答

0

CGI #Generating a Redirection Header

print CGI->redirect('http://somewhere.else/in/movie/land'); 

或者使用JavaScript的window.location

print CGI->header() . qq{ 
<html> 
<head> 
<script> 
window.location.assign("http://somewhere.else/in/movie/land") 
</script> 
</head> 
<body> 
<p>redirecting...</p> 
</body> 
</html>}; 
+0

非常感谢。 – Kannadaraj