Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Newbie
 
Join Date: Feb 2007
Posts: 10
#1: Feb 28 '07
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("dbconnect.php");
$res=mysql_query("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=mysql_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("second.php?empid={$row.[$empid]}","",width=400);return false'>
<input type='button' name='Edit' value='Dlete' onclick=window.open('delelte.php')>

</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
Newbie
 
Join Date: Feb 2007
Posts: 11
#2: Feb 28 '07

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


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