HI,
Thanx for your response.
But I have already one html form with text boxes. After the form is submitted, PHP script retrieves some values from the database and these values should be placed within already constructed textboxes.
so i think ,
<input type="text" name="thingy" value="<?php echo htmlentities($thingy)?>">.
will create a new textbox and assign value to it.
This is part of general.html
.............................................
<form name="general" action="bill.php" method="post">
<table border="2" width=750 >
<tr>
<td wiidth = 200 ><strong>Consumer Number</strong></td>
<td width = 200> <input type="text" name="cnumber"></td>
<td width = 100 ><strong>Area Code</strong></td>
<td width = 375> <select name "ac"><option>PL</option><option>AZ</option> </select></td>
</tr>
<tr>
<td width = 150 ><strong>Consumer Name</strong></td>
<td width = 200> <input type = "text" name= "cname"></td>
<td width = 100 ><strong>Category</strong></td>
<td width = 375> <select name = "cat" ><option>Domestic</option><option>Non-Domestic</option> </select></td>
</tr>
</table>
<input type="submit" value="submit"></input>
</form>
This is part of bill.php
................................
<?php
require_once("DB.php");
$db1 = new DB('localhost','postgres','','KWA');
if(!$db1->open())
{ die( $db1->error());
}
$cno=$HTTP_POST_VARS['cnumber'];
/ select consumer number if it already exists/
$qr="SELECT consumer_no,consumer_name,area_code,category FROM consumer_table where consumer_no=$cno";
if(!$db1->query($qr))
{ $db1->error();
}
while($row=$db1->fetchobject())
{
$thecn=$row->consumer_name;
$theac=$row->area_code;
$thecat=$row->category;
$cname=$thecn;
}
$db1->freeresult();
$db1->close();
?>
Here I want to get value of $thecn in the textbox. Hope you understand the problem.
thara
CET