whenever i put this code theyre will be an Error stating that there is unexpected ''"" Please help

<input type="button" value="Add to Cart" onclick="addtocart(<?=$row['serial']?>)" />

Hi
I think you should change the value to something like "Addtocart",there should be no spaces !!

Member Avatar
diafol

Looks ok to me. Try:

onclick="addtocart(<?php echo $row['serial'];?>)"

Perhaps your server doesn't support short tags.
Try taking out attributes one at a time from the input tag to see which is the offending one. But as I said, I can't see an obvious issue here. Is this a php error? If so, it may be upstream from here.

Mabye $row['serial'] contains some kind of apostrophe that is not allowed in that particular spot?