hi people i am making a dynamic form in which the results are shown . the number of results varry every time so they have to be dynamic , if the user clicks on one of the results detials button the user should be redirected to a new page with full detials of the result to make this happen i should know on which result user clicked so i must retive that data. i have used multiple things like using GET but it only gets me the last result values, if i store them in a array how to i know which index of the array is to be used ??? i hope u people can help me out
here is the code i wrote about the form may be there is some mistake in this ..kindly help me out

while($row = mysql_fetch_row($done))
    { 
    ?>
    <form name="RESULT" action="get.php" method="POST" >
    CELL ID
      <input type="text" name="cellid" value="<?php echo $row[0]?>"/>
      <label>DEGRADED KPI:
<input type="text" name="degradedkpi" value="<?php echo $row[1]?>" />
</label>
 
<label>DEGRADED KPI VALUE :
<input type="text" name="degradedkpivalue" value="<?php echo $row[2]?>"/>
</label>
    
<label>REGION
<input type="text" name="region" value="<?php echo $row[3]?>"/>

    
     <label>STATUS
<input type="text" name="status" value="<?php echo $row[4]?>"/>
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
    <p></p>
    <p></p> 
    <?php

Hey just by the look at your code is no } on your while statement .I need a bit more code if that is possible to help

Hi there,
For one, some browsers will have a problem with multiple forms with the same name, I would go with the $_GET route. Instead of outputting the data in forms like you have done, just display the results normally and where you currently have your submit button, replace it with a link as follows:

<a href="get.php?id=<? echo $row[0] ?>">View All Details</a>

Or of you want a button:

<input type="button" onclick="window.location = 'get.php?id=<? echo $row[0] ?>'" value="View All Details">

Hi there,
For one, some browsers will have a problem with multiple forms with the same name, I would go with the $_GET route. Instead of outputting the data in forms like you have done, just display the results normally and where you currently have your submit button, replace it with a link as follows:

<a href="get.php?id=<? echo $row[0] ?>">View All Details</a>

Or of you want a button:

<input type="button" onclick="window.location = 'get.php?id=<? echo $row[0] ?>'" value="View All Details">

thx buddy your this solution atleast stores first value of the form but the issue is i want to take more than one value from that form suppose $row[0] represents first name , $row[1] represents last name etc so can u help me in this regard ??

and if the values are being stored how to take these values , i mean i have to run a query with the help of this data so i need them , so please help me out !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.