单击提交按钮后重定向WordPress插件 [英] Redirect the WordPress plugin after submitting button is clicked
本文介绍了单击提交按钮后重定向WordPress插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个 WordPress 注册插件,我想要的是当用户成功注册后,将他/她重定向到一个感谢页面
I created a WordPress registration plugin, what i want is when the user is successfully registered, redirect him/her to a Thank you page
这是我的按钮代码.
<?php
if(isset($_REQUEST['submit']))
{
header("location.href="http://www.getgometro.com/thank-you/");
wp_redirect( 'http://www.getgometro.com/thank-you/' );
exit;
wp_redirect("/www.getgometro.com/thank-you/", 303);
}
?>
以上都不起作用
推荐答案
试试这个
<?php
if(isset($_REQUEST['submit']))
{ ?>
<script>
window.location="http://www.getgometro.com/thank-you/";
</script>
<?php } ?>
这不是一个正确的解决方案.你需要阅读这个如何修复标题已发送"PHP中的错误
This is not a proper solution .You need to read this How to fix "Headers already sent" error in PHP
这篇关于单击提交按钮后重定向WordPress插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文