Reputation: 476
I want to create the from that can change product data in mySQL made by PHP.
and I have the key column that auto increment and specify each product.
When i click to edit product link .it will pass the key values that i get from each product
and link to editPage.php
$Key = $data['Key'];
<a href=\"editPage.php?Key=".$Key."\">edit</a>
in editPage.php i get the key values from previous page and i want pass thisvalues to next page with submit form button.I attach Key values in action link.
<?$Key = $_GET["Key"];?>
<form id="form2" name="form1" method="post" action="editWeb.php?Key=".$Key." \">
It don't work, Can I pass Key values with another ways. Tell me if you want more information Thanks!!:))
Upvotes: 5
Views: 35626
Reputation: 639
<form id="" name="form" method="get" action="page.php"/>
<name="" input type="hidden" value="">
<input type="submit" value="">
</form>
GET->show hidden value on required page url.generally we use GET to pass values, it depend upon your requirement.
Upvotes: 2
Reputation: 160843
You need to echo the value.
<form id="form2" name="form1" method="post" action="editWeb.php?Key=<? echo $Key ?>"/>
You could also use a hidden input:
<form id="form2" name="form1" method="post" action="editWeb.php"/>
<input type="hidden" name="Key" value="<? echo $Key ?>" />
Upvotes: 10
Reputation: 35572
you need to create a hidden
input field and place that value in it. and then submit the form
<input type="hidden" id="Key" name="Key" value="<?=$Key ?>">
Upvotes: 5