I am trying to pass an multiply values from many text fields that have the same name, qty.
I read to do this I should have my form set out as such:
<input type=text name=qty[] value=$values[$i]
My code goes through a loop inserting values in the qty text field. I then use GET to send it to the next page. I was then told to use:
$quantity = serialize($_GET['qty']);
to get the data. I have to use serialize otherwise if I echo the result without serialilze i get 'Array' outputted. Using serialize i get:
a:2:{i:0;s:1:"1";i:1;s:1:"1";}
the url read:
?qty%5B%5D=1&qty%5B%5D=1
I was told that If i then used unserialize that I would get the results I wanted, but:
$quantity = unserialize($quantity);
echo $quantity;
gives me no output what so ever. Can anyone please tell me what im doing wrong? Or a better way to get the results I want?
Thanks.