Page 1 of 1

pass an html array to another file through url

Posted: Wed May 25, 2011 10:13 am
by bluestar
i want to pass an array in html anchor tag to php file ...and then shows it to the iframe something like facebook....but it dint work
code are something like that......
in html file:

Code: Select all

 <select name="value[]"multiple="multiple">
	<option value="val1">val1</option>
	<option value="val2">val2</option>
	<option value="val3">val3</option>
</select>
<a href="filename.php?val=value[]" target="ifram1">show</a>
<iframe src="file2.php" name="ifram1"></iframe
in filename.php codes are:

Code: Select all

$arr1=$_GET['val'];
print_r($arr1);

Re: pass an html array to another file through url

Posted: Wed May 25, 2011 7:02 pm
by Christopher
There are a number of problems in the code above.

- No space between name="value[]" and multiple="multiple"
- No form to submit the select.
- The syntax in the select is correct for passing arrays, but in your link sets "val" not "value" and sets it to the string "value[]"
- In filename.php it should be $_GET['value']