使用Perl脚本的HTML不返回主页面

时间:2014-04-08 05:29:11

标签: javascript html perl

我从HTML文件中的表单调用perl脚本( index.html )。

<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

1 个答案:

答案 0 :(得分: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>};