Page 2 of 2

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 7:59 am
by terrenuit
no, it doesn't work
<a href="cancel.php?ref=<?= $product['ref']; ?>"><img src="photos/garbage.jpg"></a>

and that neither
<td align="center" > <img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 8:09 am
by Celauran
You previously stated that this works:

Code: Select all

<a href="cancel.php?ref=<?php print $product['ref'] ?>">cancel</a>
But this doesn't?

Code: Select all

<a href="cancel.php?ref=<?= $product['ref']; ?>"><img src="photos/garbage.jpg"></a>
That doesn't make any sense. It's the exact same code.

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 9:19 am
by terrenuit
yes, it works correctly
<a href="cancel.php?ref=<?php print $product['ref'] ?>">cancel</a>

but not this
<a href="cancel.php?ref=<?= $product['ref']; ?>"><img src="photos/garbage.jpg"></a>

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 9:22 am
by Celauran
That really doesn't make sense. It's literally the same code. Is it generating any errors? What's happening?

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 12:00 pm
by terrenuit
I have used another way, but it doesn't work too, do you have any idea in this way ?

<td><form action="cancel.php?ref" method="post">
<input type="hidden" name="ref" value="<?php print $product['ref'] ?>">
<input type="image" name="submit" value="photos/garbage.jpg"/>
</form>
</td>

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 1:38 pm
by Celauran
If you're going to use a POST request, then the form action should be cancel.php and you'll need to change the code in cancel.php to look for $_POST['ref'] rather than $_GET['ref']

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 2:30 pm
by terrenuit
I understand the problem, for this script:
<img src="photos/garbage.jpg" width="23" height="40" border="0" usemap="#Map"> <map name="Map">
<area shape="rect" coords="2,0,34,47" href="cancel.php?ref=<?php print $product['ref'] ?>"></map>
if there is serveral items, every time cancel.php?ref=first item, which means <?php print $product['ref'] ?> always in the first item position.

but I d'ont understand why this script can cancel correctly each item, do you have any idea ?
<a href="cancel.php?ref=<?php print $product['ref'] ?>">cancel</a>

Re: shopping cart delete item

Posted: Sat Oct 04, 2014 3:34 pm
by Celauran
I have asked you if that code is being generated inside a loop, have asked to see the surrounding code, and I haven't received an answer to either. I don't know. I also don't know why you insist on using image maps.

Re: shopping cart delete item

Posted: Sun Oct 05, 2014 11:11 am
by terrenuit
I have solved the problem, the script:

<a href="cancel.php?ref=<?php print $product['ref'] ?>"> <img src="photos/garbage.jpg" width="23" height="40"></a>
thank you so much