siri Posted December 19, 2006 Share Posted December 19, 2006 Hi,I wrote a php code for adding product to cart, where i can take the product details from the database and update the quantity of the products.It is working in firefox, but in IE it is not working(i think the problem is with form input variables).Following is the code. Please can anyone help out. Thanks in advance.<form action="formprocess.php" method="post"><table><tr><td> <input type="hidden" name="cartid[]" id="cartid[]" value=<?php echo $id ?>></td></tr><tr> <td align=center><input type="checkbox" name="remove[]" id="remove[]" value=<?php echo $id ?></td> <td style="padding-left:50px"><?php echo $row2['name']; ?></td> <td align="center"><input type="text" name="quantity[]" id="quantity[]" value=<?php echo $quan ?> size=2></td> <td align="center"><?php echo "$".$row2['price']; ?></td> <td align="right"><?php echo "$".$price; ?></td> </tr> <tr><td><input type="submit" name="submit" value="submit"></td></tr></table> </form> formprocess.php<?phpfor($j=0;$j<$numrows1;$j++){ echo "Cartid".$cartid[$j]; echo "quanity:".$quantity[$j]; echo "value j".$j; $quan = $quantity[$j]; $cid = $cartid[$j]; $query2=mysql_query("update mycart set quantity='$quan' where id='$cid'"); } ?> Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/ Share on other sites More sharing options...
AV1611 Posted December 19, 2006 Share Posted December 19, 2006 Um... maybe because M$ IE sux?Sorry, couldn't resist<reprimand>(Bad av1611, bad)</self-reprimand> Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/#findComment-144566 Share on other sites More sharing options...
AV1611 Posted December 19, 2006 Share Posted December 19, 2006 um... where are you making importing your variable from the form?I don't see any $var=$_post[var];anywhere... what version of PHP? Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/#findComment-144568 Share on other sites More sharing options...
taith Posted December 19, 2006 Share Posted December 19, 2006 as much as you might not like ie, 70%+ of people use it... so you do need it to work. Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/#findComment-144574 Share on other sites More sharing options...
alpine Posted December 19, 2006 Share Posted December 19, 2006 You have an error in the checkbox remove[], you don't close it[code]<input type="checkbox" name="remove[]" id="remove[]" value=<?php echo $id ?>[/code]should be (note the last [color=red]>[/color])[code]<input type="checkbox" name="remove[]" id="remove[]" value=<?php echo $id ?>>[/code]but it would be easier to read and then again more reliable if you quoted the form elements on a regular basis, like[code]<input type="checkbox" name="remove[]" id="remove[]" value="<?php echo $id ?>">[/code]Don't know if this will fix your problem, it's an error anyhow and a typical one ie would struggle with Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/#findComment-144578 Share on other sites More sharing options...
AV1611 Posted December 19, 2006 Share Posted December 19, 2006 [quote author=taith link=topic=119263.msg488302#msg488302 date=1166547782]as much as you might not like ie, 70%+ of people use it... so you do need it to work.[/quote]True, but my statement doesn't refute that nor is my statement wrong LOLAlso, a couple of years ago it was 95% of people...But, M$ will come back with win2005, er win2006, er, win2007, er winVista...Yay for Linux Yay for FireFoxI would like to apologize to the PHPFreaks community for making a spectacle of myself, but sometimes it just has to come out...(Oh, and sorry I missed the missing > in your problem... I'll try harder to help next time) Link to comment https://forums.phpfreaks.com/topic/31249-php-code-is-not-working-in-ie/#findComment-144614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.