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? Link to comment https://forums.phpfreaks.com/topic/48577-what-is-the-problem/ 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. Link to comment https://forums.phpfreaks.com/topic/48577-what-is-the-problem/#findComment-237867 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'); } Link to comment https://forums.phpfreaks.com/topic/48577-what-is-the-problem/#findComment-237897 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 Link to comment https://forums.phpfreaks.com/topic/48577-what-is-the-problem/#findComment-237909 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.