Skip to content Skip to sidebar Skip to footer

How Can I Pass A Parameter With Submit Button On Form

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 li

Solution 1:

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 ?>" />

Solution 2:

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 ?>">

Solution 3:

<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.


Post a Comment for "How Can I Pass A Parameter With Submit Button On Form"