Jump to content

Recommended Posts

I don't know If i just have the syntax wrong or what but i am trying to send a variable through the header and it will not work.

 

current code...

//send user to topic

header("Location: showtop.php?t_id=".$_POST["t_id"]."&rt=");

 

The above works.

Below is what i am trying to do.

header("Location: showtop.php?t_id=".$_POST["t_id"]."&rt=".$_GET['rt']);

 

I put $_GET['rt'] into a variable and it echo the correct value, but when i place it in this line of code to go to the header the URL shows up without the 'rt' value. So i don't know if the sentax is wrong or what. Please help

 

example of what shows in URL "showtop.php?t_id=8&rt= "

Link to comment
https://forums.phpfreaks.com/topic/135753-header-with-variable-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.