not able to retriving values from one page to another page.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hyperion
    New Member
    • Feb 2007
    • 10

    not able to retriving values from one page to another page.

    Hello,
    Here is my problem in my first.php program I retrieved values from the database and displayed (each row contails one display and one edit button),when I click on edit button The page should be redirected to second.php and the id of that particular row should be retrived to the second.php page so that based on that id i can delete or upadte the data.
    [php]
    <html>
    <body>
    <table width="53%" border="0" cellspacing="5" cellpadding="0" align="left">
    <form action="update. php" method='post'>
    <?php
    include("dbconn ect.php");
    $res=mysql_quer y("select * from addemployee ");

    echo"<table border='1'>
    <tr>
    <th>name</th>
    <th>platform</th>
    <th>designation </th>
    <th>id</th>
    <th>taddr</th>
    <th>paddr</th>
    <th>email</th>
    <th>idcno</th>
    <th>phno</th>
    <th> update<th>
    </tr>";
    while($row=mysq l_fetch_array($ res))

    {

    echo "<tr>";
    echo "<td>&nbsp; " . $row['name'] . "</td>";
    echo "<td>&nbsp; " . $row['platform'] . "</td>";
    echo "<td>&nbsp; " . $row['designation'] . "</td>";
    echo "<td>&nbsp; " . $row['id'] . "</td>";
    echo "<td>&nbsp; " . $row['taddr'] . "</td>";
    echo "<td>&nbsp; " . $row['paddr'] . "</td>";
    echo "<td>&nbsp; " . $row['email'] . "</td>";
    echo "<td>&nbsp; " . $row['idcno'] . "</td>";
    echo "<td>&nbsp; " . $row['phno'] . "</td>";
    echo " <input type='hidden' value='$row[empid]' name='empid'>";

    echo "<td>
    <input type='button' name='Edit' value='Edit' onclick= 'self.open("sec ond.php?empid={ $row.[$empid]}","",width=400 );return false'>
    <input type='button' name='Edit' value='Dlete' onclick=window. open('delelte.p hp')>

    </td>";
    echo"</tr>";
    }
    echo "</table>";
    ?>
    </form>
    </table>
    </body>
    </html>[/php]
    Read the Posting Guidelines at the top of this forum!!
    Especially the part about enclosing shown code within php or code tags!!!

    moderator

    by this code Im not able to retrive id to second .php page.
    please help me.
    regards,
    ramya
  • snapple
    New Member
    • Feb 2007
    • 11

    #2
    well, you are sending the page to 'update.php' instead of 'second.php'

    Comment

    Working...