dt97868
dt97868
2014-12-18 10:56

单击提交按钮后重定向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

Here is my button code.

<?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);
}  
?>

None of the above is working

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • dsplos5731 dsplos5731 7年前

    Try this

     <?php 
     if(isset($_REQUEST['submit']))
      { ?>
    
    <script>
    window.location="http://www.getgometro.com/thank-you/";
    </script>
    
    
    <?php } ?>
    

    This is not a proper solution .You need to read this How to fix "Headers already sent" error in PHP

    点赞 评论 复制链接分享
  • dqm83011 dqm83011 7年前

    use

    <meta http-equiv='refresh' content='0;"$yourLink"'>
    

    where $yourLink contain link address to which you want to redirect user.

    点赞 评论 复制链接分享

相关推荐