0

hey all

i have an array stored in a variable - $SelectRoom which is put through a foreach to display each value of the array:

foreach($SelectRoom as $value)
{
  echo $value;
}

no that works fine however i want to send this array through the url with other variables to the next page so i can use the values there again in the same manner.

href ="Payment.php?daysOfMonth=".$dayArrive."&monthOfYear=".$month."&year=".$year."&nights=".$nights."&SelectRoom[] =".$SelectRoom;

however it seems to not be the thing...

------------------------
Payment.php - recieving page
----------

if (isset($_GET['daysOfMonth'])) 
{
	$dayArrive = $_GET["daysOfMonth"];
	$month = $_GET["monthOfYear"];
	$year = $_GET["year"];
	$nights = $_GET["nights"];
	$selectRoom = $_GET["SelectRoom"];
}

foreach($selectRoom as $value)
{
  echo $value;
}

can anyone shed some light on this problem for me???

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by gchurch
0

I'm not sure, I have never tried passing an array as a URL parameter. However, you could save the array as a session and simply get the contents of it on the payment page. Or even a bunch of hidden fields and get the values through $_post rather than $_get?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.