href & <form action not working

I am a newbie, and need some help, so I hope someone who knows the solution to this problem will respond. This problem is an obstacle to setting up my online store, which I need to have working ASAP. I am trying to prevent the customer from a quantity of zero to be going to the checkout pages. In the program view_product.php, I intentionally set the default quantity to zero; the customer needs to change the quantity before proceeding, and is accompanied by an ‘Add to Cart’ button. The idea is when the customer does not change the quantity to a positive integer, it should go back to the same web page, and the error message ‘Cannot have a quantity of zero or less’ should be displayed in the web page produced by view_product.php. The following code should be working correctly, and is not. All I am getting is a blank screen with the ‘Cannot have a quantity of zero or less’ error message.

if ($qty == 0) {
echo ‘’;
echo ‘

’;
echo ‘

’;
echo 'Cannot have a quantity of zero or less ';
echo ‘
’;
echo ‘’;
} else if {
…etc…

DonG

you have not define product name in anchor tag. see below example

if ($qty == 0) {
echo ‘’;
echo ‘

’;
echo ‘

Product name

’;
echo 'Cannot have a quantity of zero or less ';
echo ‘
’;
echo ‘’;
} else if {
…etc…

Why not add onSubmit in your form? Like:

. . .
Sponsor our Newsletter | Privacy Policy | Terms of Service