i type the following code....
it runs properly....data gets fetch but i am not able to display it in a textbox....
it simply remains blank....whereas i am able to fetch the data outside the form tags
here is my code:
here i can see name =himanshu outside the form but in the inside the textbox remain blank
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style type="text/css">
div
{
font-size:18px;
}
BODY {
max-width : 900px;
margin-left:auto;
margin-right:auto;
}
</style>
<title></title>
</head>
<body>
<?php
define('DB_USERNAME', 'akshay');
define('DB_PASSWORD', 'akshay321');
define('DB_DATABASE', '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.16.13.213)(PORT=1521)) (CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME = orcl)))');
$conn= oci_connect(DB_USERNAME, DB_PASSWORD, DB_DATABASE)
or die(oci_error());
echo "success...";
example_query($conn);
function example_query ($conn) {
// Parse a query containing a bind variable.
$stmt = oci_parse($conn, "SELECT * ".
"FROM him_details ");
// Execute the completed statement.
oci_execute($stmt, OCI_DEFAULT);
while (oci_fetch($stmt))
{
$name = oci_result($stmt, "NAME");
$branch = oci_result($stmt, "BRANCH");
$smobile = oci_result($stmt, "SMOBILE");
$eno = oci_result($stmt, "ENO");
$hostel = oci_result($stmt, "HOSTEL");
$room = oci_result($stmt, "ROOM");
$fmobile = oci_result($stmt, "FMOBILE");
$address = oci_result($stmt, "ADDRESS");
echo "name=$name ";
}
}
?>
<div style="position:absolute; width:900px; height:900px; border: 2px solid #000000;">
<div>
<table width="900" height="98" border="1" cellpadding="0" cellspacing="0" bordercolor="#000066" bgcolor="#ffcc00" align="center">
<tr>
<td width="900" nowrap rowspan="8"><p align="center" class="style1"> <IMG align=absMiddle src="PS.jpg" width=89 height=87> <span class="style2">SIR PADAMPAT SINGHANIA UNIVERSITY</span></p></td>
</tr>
</table>
</div>
<form id="form1" runat="server">
<div style="position:absolute; width:400px; height:325px; top:150px; left:225px;">
<label style="float:left; border-left-width:thick;">Name:</label>
<input style="float:right; border-right-width:thick" name="name" type="text" value="<?php echo $branch;?>" />
<br /><br />
<label style="float:left; border-left-width:thick;">Branch:</label>
<input style="float:right; border-right-width:thick" name="branch" type="text" value="<?php echo $branch;?>" />
<br /><br />
<label style="float:left; border-left-width:thick;">Student Mobile No.</label>
<input style="float:right; border-right-width:thick" name="mobile_no" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Enrollment No.</label>
<input style="float:right; border-right-width:thick" name="enroll_no" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Hostel No.</label>
<input style="float:right; border-right-width:thick" name="hostel_no" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Room No.</label>
<input style="float:right; border-right-width:thick" name="room_no" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Father's/Gardian no.</label>
<input style="float:right; border-right-width:thick" name="guardin_no" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Address</label>
<textarea style="float:right; border-right-width:thin; resize:none" type="text" name="" cols="16" rows="2"></textarea>
<br />
<br />
</div>
<input name="student_image" style="position:absolute; top:150px; left:700px" width="150" height="150" type="image" id="student_image" src="200x200.jpg" align="right" />
<hr align="right" style="position:absolute; top: 500px; height: 0px;" width="900" 800px" />
<div id="fill_outpass" style="position:absolute; width:400px; height:325px; top:600px; left:225px;">
<label style="float:left; border-left-width:thick;">Date:</label>
<input style="float:right; border-right-width:thick" id="date" name="date" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Out Date:</label>
<input style="float:right; border-right-width:thick" name="out_date" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">Out Time</label>
<input style="float:right; border-right-width:thick" name="out_time" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">In Date:</label>
<input style="float:right; border-right-width:thick" name="in_time" type="text" />
<br /><br />
<label style="float:left; border-left-width:thick;">In Time:</label>
<input style="float:right; border-right-width:thick" name="in_time" type="text" />
<br /><br />
</div>
<div style="position:absolute;width:200px; height:100px; top:850px; left:225px;" >
<input name="Submit" type="button" style="float:left" value="Submit" />
<input name="Reset" type="button" style="float:right" value="Reset" />
</div>
</form>
</div>
</body>
</html>