co.ador Posted February 11, 2010 Share Posted February 11, 2010 buy.php <form action="cart.php" method="post"> <?php foreach($product['varieties'] as $variety): ?> <input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="<?php echo $variety['price'] . '_' . $variety['size']; ?>" />'; <?php end foreach; ?> </form> cart.php <?php list($aDoor, size) = split('_', $_POST['price']); // line 207 if(empty($aDoor)) { echo("You didn't select any buildings."); } else { echo "Sum of vlues = ".array_sum($aDoor); } ?> in cart.php there is the following syntax error. syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in store/cart.php on line 207 I am expecting in cart.php to receive the two index values size and price independetly so I can use it and CSS it where ever i want. I am expecting that with the function list() and split() the variables variety and $aDoor with the price value will able to separate this two variables to be use wherever I want in cart.php help. Quote Link to comment Share on other sites More sharing options...
xjake88x Posted February 11, 2010 Share Posted February 11, 2010 Just realized you do indicate which line is 207. Also the "split" function is deprecated and highly discouraged (by the php manual). It's also not what you want, it uses regex. Use "explode" instead, same parameters. A Paamayim Nekudotayim is a double colon like :: which you would use to call a static member function of a class. Quote Link to comment Share on other sites More sharing options...
co.ador Posted February 11, 2010 Author Share Posted February 11, 2010 see cart.php the first line is 207 it is signaled in comments list($aDoor, size) = split('_', $_POST['price']); // line 207 Quote Link to comment Share on other sites More sharing options...
xjake88x Posted February 11, 2010 Share Posted February 11, 2010 Yeah sorry I just realized that, haha. Try changing it to explode because that can be thought of as an "internal error" in that context. Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted February 12, 2010 Share Posted February 12, 2010 size should be $size Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.