Jump to content

php code is not working in IE


siri

Recommended Posts

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

<?php
for($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
Share on other sites

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
Share on other sites

[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 LOL

Also, 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 FireFox

I 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.