Ok folks,
I unfortuneately have had no such luck with my problem of passing
arrays through <a href and have tried playing with the replies to my posting but
just can't quite crack it. I have no problems with normal form submission using
submits and so on.
Here is the complete code listing and explantion of the problem.
Explanation: $->display_product($category); This is a funtion that displays the
product lists depending on the $category value. It returns two arrays, $prod_des and
$price. They are then formated on the page accordingly. I then use <a href>
which directs to a function within a switch statement($boxaction) which inturn activates an add_item method (to the cart table).
The value of $prod_des is not being passed to the add_item method, instead the word array goes in the table.
Please Help! before I self-combust.
T.I.A
code listing:
<?php
$g->display_product($category);
?>
<form>
<table cellspacing=5 cellpadding=5 bgcolor=grey align=center>
<tr><td><b>Product</td><td><b>Price</td></tr>
<?php
for($x=0;$x<count($prod_des);$x++)
{
print "<tr><td>$prod_des[$x]</td><td>$price[$x]</td>
<td><a href=\"$PHP_SELF?boxaction=additem&prod_des[]=$prod_des[$x]&price[]=$price[$x]\">
<b>Send To Shopping cart</a>";
}
?>
</td><tr>
<br><br>
</tableš”