hi,
i have a form called delete.php which retrieves all the rows frm databse..
and thr is one button called Change which links to form called test.php...
in this form the changes are made to entries in delte.php..
so i need to use POST method to to retrieve entries from delete.php..
bt ..evn aftr using its nt wrking..help me out..
here is d delete.php form
<html>
<head>
<title>Change details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<table width="379" border="1">
<tr>
<td width="27%"><div align="center">Hotel Name</div></td>
<td width="23%"><div align="center">Star Rating</div></td>
<td> <div align="center">City</div>
</tr>
<?php
echo'<form method="post" action="test.php">';
@mysql_select_db('Travel') or die("cannot select the database");
$sql="select * from details";
$rs=mysql_query($sql) or die("cannot select");
echo $sql;
while($resource=mysql_fetch_array($rs))
{
if($resource['city'] ==0)
{
$district='North Goa';
}
if($resource['city']==1)
{
$district='South Goa';
}
if($resource['star_rating']==0)
{
$rating='Any';
}
if($resource['star_rating']==1)
{
$rating='1 Star';
}
if($resource['star_rating']==2)
{
$rating='2 Stars';
}
if($resource['star_rating']==3)
{
$rating='3 Stars';
}
if($resource['star_rating']==4)
{
$rating='4 Stars';
}
if($resource['star_rating']==5)
{
$rating='5 Stars';
}
echo"<tr>";
echo"<td valign=top><input type=text name=hotelname value=".$resource['hotel_name']." ></td>";
echo"<td valign=top><input type=\"text\" name=\"rating\" value=".$rating." ></td>";
echo"<td valign=top><input type=\"text\" name=\"city\" value=".$district." ></td>";
echo"<td valign=top><a href='test.php'>Change</a></td>";
echo"</tr>";
echo'</form>';
}
?>
</table>
<form action=main.php>
<div align="center">
<Input type="submit" value="DONE">
</div>
</form>
</body>
</html>
and here is the test.php
which is not able to post the entries...
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
@mysql_select_db('Travel') or die("cannot select the database");
$hotelname=$_POST['hotelname'];
echo $hotelname;
$query="SELECT hotel_name from details where hotel_name=".$hotelname." ";
$rs=mysql_query($query);
echo'<table>';
echo'<tr><td>hotel name</td>';
echo'<td><input type=text name=hotelname value='.$hotelname.'></td></tr>';
echo'</table>';
?>
</body>
</html>