PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
C_Calav
Forum Contributor
Posts: 395 Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand
Post
by C_Calav » Mon Aug 09, 2004 12:05 am
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
<a href="<?php echo $_POSTї'url'];?>.php">continue shopping</a>
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
timvw
DevNet Master
Posts: 4897 Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium
Post
by timvw » Mon Aug 09, 2004 1:24 am
C_Calav wrote: 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; ?>">
Code: Select all
<a href="<?php echo $_POSTї'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.