Page 1 of 1

POST help

Posted: Mon Aug 09, 2004 12:05 am
by C_Calav
page 1

Code: Select all

<form name="form1" method="post" 
action="cart.php?action=add_item&id=<?php echo $rowї"itemId"]; ?> &qty=1&url=<?php echo $P_Cat; ?>">
page 2

Code: Select all

<?php
   case "add_item": 
      { 
         AddItem($_GET["id"], $_GET["qty"],  $_GET["url"]); 
         ShowCart($rs_cart); 
         break; 
      } 
?>

Code: Select all

&lt;a href="&lt;?php echo $_POST&#1111;'url'];?&gt;.php"&gt;continue shopping&lt;/a&gt;

but the result i get is http://www.mysite/.php

am i doing something wrong? am i "GETTING" the variable properly from the previous page?

thanx

Re: POST help

Posted: Mon Aug 09, 2004 1:24 am
by timvw
C_Calav wrote:page 1

Code: Select all

<form name="form1" method="post" 
action="cart.php?action=add_item&id=<?php echo $row&#1111;"itemId"]; ?> &qty=1&url=<?php echo $P_Cat; ?>">

Code: Select all

<a href="<?php echo $_POST&#1111;'url'];?>.php">continue shopping</a>
but the result i get is http://www.mysite/.php
Well, you are not POSTing url. You are passing it as a GET variable (as it's in the URL you request).

If you add a <input type="hidden" name="url" value="<?= $P_CAT ?>" /> to your input form, it will be available in $_POST.