I have a form that post to basket.php page, upon form submission it redirects to basket.php page and back to order page(page where form is located). it happens fast but you can still see the basket page for a just second, how do i stop the form from showing the basket.php page at all but still refresh the current page(order page).
My code:
<?php
echo '<div class="food">';
echo '<form method="post" action="basket.php"
onsubmit="window.location.reload()" >';
echo '<h4>'.$obj->food_title.'</h4>';
echo '<div class="pic"><img src="admin/food_images/'.$obj->food_image.'"
width= "180" height= "160"></div>';
echo "<p><b>£".$obj->food_price."</b></p>";
echo '<div class = "btn"><a href="info.php?foo_id='.$obj->food_id.'"
style="float:left">INFO</a></div>';
echo '<div class = "add_b"><button>Add to Basket</button></div>';
echo '<input type="hidden" name="food_code"
value="'.$obj->food_id.'" />';
echo '<input type="hidden" name="type" value="add" />';
echo '</form>';
echo '</div>';
?>