使用 type="submit" 和 method="GET":
echo "<form method ='GET' action='cart.php'>";
echo "<p><label> Quantity: ";
echo "<input name='quantity' type='text' pattern='[1-9]{1,50}'/>";
echo "</label>";
echo "
<input type='hidden' name='pid' value='$prodID' />
<input type='submit' value='Add To Cart' />
";
echo "</p></form>";