Mario Legenda
Mario Legenda

Reputation: 759

Sending multiple values in header() function with GET method

my question is about the header() function. I'm trying to send 2 variables trough this function like this:

header("Location:index.php?variable_1='true'&variable_2='false'");

I think its the problem in escaping & but i tried it just with &. Also, first variable gets initialized and I can acquire it by calling$_GET['variable_1']` but the second one is none existent and is not initialized.

So my question is, can I send more than one value trough header() function via GET method?

Thank you for your time!

Upvotes: 4

Views: 10130

Answers (2)

Shri Harry
Shri Harry

Reputation: 103

Try this:

header("Location:index.php?variable_1=true&variable_2=false");

Upvotes: 1

HiDd3N
HiDd3N

Reputation: 504

yes,you can just in case to do that

header("Location: index.php?variable_1=true&variable_2=false");

you dont need to use '' this

Upvotes: 5

Related Questions