riddhi Posted April 25, 2007 Share Posted April 25, 2007 echo "<br /><br />"; echo " <div align='right'> "; echo "<form name='form1' method='post'>"; echo "<input name='cart' type='submit' value='Add To Cart' />"; echo "</form>"; echo "</div>"; if(isset($cart)){ for ($i=0; $i < count($productId); $i++) { $_GET['p']=$productId[$i]; addToCart(); } $_GET['action'] = "view"; include('cart.php'); } when I click the button budget.php is called instead of cart.php what is the remedy? Quote Link to comment Share on other sites More sharing options...
Heero Posted April 25, 2007 Share Posted April 25, 2007 You form method is set to post and you are using the global variables GET which has nothing them. Either set the form method to post, or use the POST global variables. Quote Link to comment Share on other sites More sharing options...
riddhi Posted April 25, 2007 Author Share Posted April 25, 2007 thanks for pointing out but the latter part of the script is not working ie. this part if(isset($cart)){ for ($i=0; $i < count($productId); $i++) { $_GET['p']=$productId[$i]; addToCart(); } $_GET['action'] = "view"; include('cart.php'); } Quote Link to comment Share on other sites More sharing options...
btherl Posted April 25, 2007 Share Posted April 25, 2007 Please post your full code, including the part which calls budget.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.