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

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.

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.