For example i have two files one in index.php & another is check.php.
index.php
[code=html]
<body>
<form id="form1" name="form1" method="post" action="check.p hp?id=tbl1">
<table width="200" border="1">
<tr>
<td colspan="2">Pes onal Info Table 1 </td>
</tr>
<tr>
<td width="72">Name :</td>
<td width="112"><in put name="name" type="text" id="name" value="Ashok" /></td>
</tr>
<tr>
<td>Address</td>
<td><input name="address" type="text" id="address" value="Kathmand u" /></td>
</tr>
<tr>
<td><input name="tbl1" type="submit" id="tbl1" value="Submit" /></td>
<td><input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</form>
</br>
</br>
<form id="form3" name="form3" method="post" action="check.p hp?id=tbl2">
<table width="216" border="1">
<tr>
<td colspan="2">Per sonal Info Table 3 </td>
</tr>
<tr>
<td width="56">Phon e</td>
<td width="144"><in put name="phone" type="text" id="phone" value="98416143 20" /></td>
</tr>
<tr>
<td>Email</td>
<td><input name="email" type="text" id="email" value="alok_in1 @yahoo.com" /></td>
</tr>
<tr>
<td><input name="tbl2" type="submit" id="tbl2" value="Submit" /></td>
<td><input type="reset" name="Submit6" value="Reset" /></td>
</tr>
</table>
</form>
</body>
[/code]
& Second is check.php
[code=php]
foreach($_POST as $key=>$value)
{
//echo "</br>";
$key.":".$$key= $value;
//echo "</br>".$key;
}
[/code]
So the problem is that, when we fetch the data from $_POST method. how to keep the key & value variable into different array.
like:
[code=php]$field=array('n ame,'address ',......');
&
$value=array('A shok','Kathmand u','... '); [/code]
Thank you.
index.php
[code=html]
<body>
<form id="form1" name="form1" method="post" action="check.p hp?id=tbl1">
<table width="200" border="1">
<tr>
<td colspan="2">Pes onal Info Table 1 </td>
</tr>
<tr>
<td width="72">Name :</td>
<td width="112"><in put name="name" type="text" id="name" value="Ashok" /></td>
</tr>
<tr>
<td>Address</td>
<td><input name="address" type="text" id="address" value="Kathmand u" /></td>
</tr>
<tr>
<td><input name="tbl1" type="submit" id="tbl1" value="Submit" /></td>
<td><input type="reset" name="Submit2" value="Reset" /></td>
</tr>
</table>
</form>
</br>
</br>
<form id="form3" name="form3" method="post" action="check.p hp?id=tbl2">
<table width="216" border="1">
<tr>
<td colspan="2">Per sonal Info Table 3 </td>
</tr>
<tr>
<td width="56">Phon e</td>
<td width="144"><in put name="phone" type="text" id="phone" value="98416143 20" /></td>
</tr>
<tr>
<td>Email</td>
<td><input name="email" type="text" id="email" value="alok_in1 @yahoo.com" /></td>
</tr>
<tr>
<td><input name="tbl2" type="submit" id="tbl2" value="Submit" /></td>
<td><input type="reset" name="Submit6" value="Reset" /></td>
</tr>
</table>
</form>
</body>
[/code]
& Second is check.php
[code=php]
foreach($_POST as $key=>$value)
{
//echo "</br>";
$key.":".$$key= $value;
//echo "</br>".$key;
}
[/code]
So the problem is that, when we fetch the data from $_POST method. how to keep the key & value variable into different array.
like:
[code=php]$field=array('n ame,'address ',......');
&
$value=array('A shok','Kathmand u','... '); [/code]
Thank you.
Comment