Adding Code in a "Location" line for a redirect page?

I apologize, I can’t even explain this well.

I have a wordpress template that simply redirects to another page. The code looks like this

[code]

<?php header('Location: http://[justvar code="id"].wakeupnow.com/signup/'); die(); ?>

[/code

You’ll notice I have a shortcode in the link…that is what I need to work…however it obviously just reads the shortcode as text and returns it’s value…how can I make it read the shortcode instead?[/code]

Woops…missed closing my code tag so hard to read the bottom of the text. Here’s what it said for ease of use:

<?php header('Location: http://[id].wakeupnow.com/signup/');

      die();

?>

You’ll notice I have a shortcode in the link…that is what I need to work…however it obviously just reads the shortcode as text and returns it’s value…how can I make it read the shortcode instead?

I don’t use wordpress, so I can’t test it, but I think it’s suppose to be something like this.

[php] <?php header(‘Location: http://’ . do_shortcode("[id]") . ‘.wakeupnow.com/signup/’);

   die();

?>[/php]

I will try that, thank you :slight_smile:

That threw an error, but I just had to change the double quotes to single quotes in the shortcode.

 <?php header('Location: http://' . do_shortcode('[id]') . '.wakeupnow.com/signup/');
  
        die();
  
  ?>

Thanks!

Sponsor our Newsletter | Privacy Policy | Terms of Service