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???

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?

hey thanks man the session worked just fine

Once

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.