dpny
03-02-2008, 01:51 PM
Ok, I am really stuck on this and been searching on here as well as google for the last 2 hours without any luck.
Here is the situation:
I want to pass a multi selectable checkbox as an array to one file called index.php, so on my form page.. I have a for loop that repeats this process 16 times. The form is processed using GET method.
echo "<input name=\"song[]\" type=\"checkbox\" value=\"".$counter."\">";
Now, the index.php holds the variable so I retrieve it using:
foreach($_GET['song'] as $value) {
echo "Checked: $value\n";
}
Cool, this will print out each value... now I want to pass this entire array into a second page in this manner, on the same page:
echo "<a href=\"2nd_page.php?song=$song\">link</a>
I want the $song to carry out the entire array which was passed into index.php to 2nd_page.php.... how can I do that? I dont really want to print out the $value really, that was to see if it works.
I've tried doing this on index.php
$song = $_GET['song'];
and then I did echo to see what shows, it simply displays "Array" nothing else. How can I do this?
Thanks in advanced.
-DPNY
Here is the situation:
I want to pass a multi selectable checkbox as an array to one file called index.php, so on my form page.. I have a for loop that repeats this process 16 times. The form is processed using GET method.
echo "<input name=\"song[]\" type=\"checkbox\" value=\"".$counter."\">";
Now, the index.php holds the variable so I retrieve it using:
foreach($_GET['song'] as $value) {
echo "Checked: $value\n";
}
Cool, this will print out each value... now I want to pass this entire array into a second page in this manner, on the same page:
echo "<a href=\"2nd_page.php?song=$song\">link</a>
I want the $song to carry out the entire array which was passed into index.php to 2nd_page.php.... how can I do that? I dont really want to print out the $value really, that was to see if it works.
I've tried doing this on index.php
$song = $_GET['song'];
and then I did echo to see what shows, it simply displays "Array" nothing else. How can I do this?
Thanks in advanced.
-DPNY
