Simple Project(part 3c)

.....................................................................................

This code is for displaying the profile after insertion.


.....................................................................................



viewMyProfile.php:




<?php
session_start();
?>


<table cellpadding="0" cellspacing="0" bgcolor="#FFDFFF" width="900px;">

<tr>




<?php
include("connect.php");




echo $query="select * from create_profile where userid='{$_SESSION['id']}'";
$result=mysql_query($query);
$dataPacket =mysql_fetch_array($result);



?>


</tr>


</table>
<table cellpadding="3" cellspacing="3" bgcolor="#C9C9C9" width="900px;">
<tr>
<td colspan="4" rowspan="2" valign="middle" height="50px" align="left" style=" font-family:Verdana, Geneva, sans-serif; font-weight:bold; font-size:14px; margin-left:70px; ">My Profile</td>
</tr>
<tr>
<td align="right" style=" font-family:Verdana, Geneva, sans-serif; font-weight:bold; font-size:14px; margin-left:70px; "><a href="editProfile.php?id=<?php echo $dataPacket['id']; ?>">Edit Profile</a></td>
</tr>
<caption style="background-color: #999; color: #FFF; font-size:14px; font-weight:bold;"> Congratulations ! Ur profile is created.</caption>

<tr>
<th width="35%">Name:</th>
<td><?php echo $dataPacket['userName']; ?></td>

</tr>
<tr>
<th>Father's Name:</th>
<td><?php echo $dataPacket['userfatherName']; ?></td>
</tr>
<tr>
<th>Occupation:</th>
<td><?php echo $dataPacket['userOccupation']; ?></td>
</tr>
<tr>
<th>Nationality:</th>
<td><?php echo $dataPacket['userNationality']; ?></td>
</tr>
<tr>
<th>Religion:</th>
<td><?php echo $dataPacket['userReligion']; ?></td>
</tr>
<tr>
<th>Address:</th>
<td><?php echo nl2br($dataPacket['userAddress']); ?></td>
</tr>
<tr>
<th>Designation:</th>
<td><?php echo $dataPacket['userDesignation']; ?></td>
</tr>
<tr>
<th>Country:</th>
<td><?php echo countryName($dataPacket['country']); ?></td>
</tr>


</table>
<?php
function countryName($id)
{
$query="select COUNTRY from countrys where COUNTRY_ID='$id'";
$res=mysql_query($query);
$result=mysql_fetch_array($res);
$result=$result['COUNTRY'];
return $result;
}

?>

0 Response to "Simple Project(part 3c)"

Post a Comment

powered by Blogger | WordPress by Newwpthemes | Converted by BloggerTheme