Reputation: 759
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
Reputation: 103
Try this:
header("Location:index.php?variable_1=true&variable_2=false");
Upvotes: 1
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