向功能性提交按钮添加一个href


add a href to a functional submit button

如何让提交按钮在同一页面打开链接,同时该按钮提交输入到我的php文件?下面是我的代码作为参考:

<form id="input" action="archive.php" method="get">        
    <textarea rows="3" cols="10" name="content" id="content" class="txt" placeholder="blah blah..." required></textarea>
    <input type="submit" id="submit"/>
</form>

在您的archive.php中,将浏览器重定向到新位置。您可以使用header()来完成此操作。

header('Location: http://www.url.com');

这样,您的所有处理将在archive.php中运行,同时,所有用户将看到的是他到达您指定的URL。