Jump to content

[SOLVED] Passing multiple variables in header URL


TGWSE_GY

Recommended Posts

okay here is what the header looks like so far,

 

header ("Location: http://www.thegayestcommunityever.com/dev/index.php?section=fsearchresults");

that forwards them to the next page but I am wanting to pass an additional value with that header would I use & char for separating variables in header.

 

Thanks

Link to comment
Share on other sites

Ahh, you are mixing up headers, and URL variables. The headers are information that are sent along with a document to tell the receiving system what to do with it. I told you how to pass some variables as headers - but you have to pull them out as headers as well.

 

You are trying to pass variables in the URL. You can do that like this:

 

example.com?var1=dog&var2=cat&var3=monkey

 

Separate each of the variables using the & sign.

 

If you are using XHTML, then you probably want to use this instead:

 

example.com?var1=dog&var2=cat&var3=monkey

 

separate each of the variables using & - this is valid XHTML.

 

Link to comment
Share on other sites

Mate, you didn't read what I wrote. You aren't passing variables in the header, you are passing variables in the URL.

 

To get the values, you use:

 

$_GET['var1']  // This will be equal to dog
$_GET['var2']  // This will be equal to cat
$_GET['var3']  // This will be equal to monkey

Link to comment
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.