0

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

  • 1
    `header("Location: http://www.getgometro.com/thank-you/");` maybe? And your question is? – Rizier123 Dec 18 '14 at 10:57
  • There is syntax error in your header. Check [here](http://php.net/manual/en/function.header.php). – Rohil_PHPBeginner Dec 18 '14 at 11:01
  • @Rizier123 it display this message: ** Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wordpress/wp-content/themes/twentyfourteen/header.php:52)** – Simphiwe Innocent Dec 18 '14 at 11:13
  • possible duplicate of [How to fix "Headers already sent" error in PHP](http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php) – Rizier123 Dec 18 '14 at 11:14

2 Answers2

0

use

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

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

Shamsuddin Altamash
  • 163
  • 1
  • 3
  • 11
0

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

Community
  • 1
  • 1
Sagin
  • 989
  • 8
  • 8