I used dreamweavers in built functionality (So when i appled the login user to the form, i also used the option in the wizard to direct user to the profilepage once the user is logged in)! After this i attempted to use session code mentioned in the last post at the top of the page, then used record sets & bindings & were-function to display the logged in users profile data from the database!!!
I have posted the whole of the page code below:
- PHP: Select all
<?php require_once('Connections/dbman.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_rsRegist = "-1";
if (isset($_GET['id'])) {
$colname_rsRegist = $_GET['id'];
}
mysql_select_db($database_dbman, $dbman);
$query_rsRegist = sprintf("SELECT tbl_age.agename, tbl_developer.developername, tbl_regist.registname, tbl_regist.registusername, tbl_regist.registpassword, tbl_regist.registphoto FROM tbl_regist, tbl_age, tbl_developer WHERE registid = %s AND tbl_regist.registage = tbl_age.ageid AND tbl_regist.registdeveloper = tbl_developer.developerid", GetSQLValueString($colname_rsRegist, "int"));
$rsRegist = mysql_query($query_rsRegist, $dbman) or die(mysql_error());
$row_rsRegist = mysql_fetch_assoc($rsRegist);
$totalRows_rsRegist = mysql_num_rows($rsRegist);
?><!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Display Profile</title>
<style type="text/css">
<!--
body {
background-color: #F4F4FF;
}
-->
</style>
<link href="style/screen.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
color: #666666
}
-->
</style>
</head>
<body>
<div align="center">
<p>Profile Display</p>
<table width="597" height="527" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="597" height="34"><div align="center">Welcome. You are now logged in as: <?php echo $row_rsRegist['registname']; ?></div></td>
</tr>
<tr>
<td height="459" valign="top"><table width="596" height="461" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="442" valign="top"><div align="center">
<p> </p>
<table width="295" height="249" border="0" cellpadding="0" cellspacing="0" id="frm_insert">
<tr>
<td width="121" height="47"><div align="left">Name:</div></td>
<td width="174"><?php echo $row_rsRegist['registname']; ?></td>
</tr>
<tr>
<td height="53"><div align="left">Age:</div></td>
<td><?php echo $row_rsRegist['agename']; ?></td>
</tr>
<tr>
<td><div align="left">Developemnt Skills:</div></td>
<td><?php echo $row_rsRegist['developername']; ?></td>
</tr>
<tr>
<td><div align="left">Login name:</div></td>
<td><?php echo $row_rsRegist['registusername']; ?></td>
</tr>
<tr>
<td><div align="left">Login Password:</div></td>
<td><?php echo $row_rsRegist['registpassword']; ?></td>
</tr>
</table>
<p> </p>
</div></td>
<td width="154" valign="top"><table width="154" height="461" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="196"><img src="uploads/<?php echo $row_rsRegist['registphoto']; ?> " width="197" height="228" alt="" /></td>
</tr>
<tr>
<td valign="top"><table width="198" height="264" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a href="Index.php" class="style1">Index</a></div></td>
</tr>
<tr>
<td><div align="center"><a href="Edit_account.php" class="style1">Edit Profile</a></div></td>
</tr>
<tr>
<td><div align="center"><a href="Control_panel.php" class="style1">Control Panel</a></div></td>
</tr>
<tr>
<td><div align="center"><a href="Search_engine.php" class="style1">Search Members</a></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center"></div></td>
</tr>
</table>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($rsRegist);
?>
Thanks for the help mate.