what i am trying to do is create a my account page so you can review and edit your information and i am trying to pull the proper record by using the session “username”
here is the code
<?
session_start();
if (empty($_SESSION['username'])){
header("location:index1.php");
exit;
}
?>
<!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>My Creative Process</title>
<style type="text/css">
<!--
.style1 {color: #666666}
-->
</style>
<link href="/css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 { color: #f73602;
font-weight: bold;
}
.style3 {
color: #FFFFFF
}
.style4 {color: #F15A25}
-->
</style>
</head>
<body>
<table width="972" border="0" cellspacing="0" cellpadding="5">
<tr>
<td><div align="right">Logged in as: <? echo $_SESSION['username'];?></div></td>
</tr>
</table>
<table width="972" border="1" align="center" cellpadding="5" cellspacing="0" bordercolor="#F73602" id="frame">
<tr bordercolor="#F15A25">
<td colspan="4"><div align="center">
<p><img src="/images/header.jpg" width="942" height="84" /></p>
<table width="902" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="728"><p><span class="style1"><a href="/index.php">home</a> | <a href="/main_forum.php">review</a> | <a href="/create_topic.php">post</a> | <a href="/mindgames.php">mindgames</a> | <a href="/archive.php">archive</a> | <a href="/brainstorm.php">brainstorm</a> | <a href="/my_account.php">my account</a> | <a href="/suggestion_box.php">suggestion box</a></span></p> </td>
<td colspan="-1"><div align="right">
<?
//echo "You've been logged in since" . $_SESSION['time'] . "<br>";
echo '<a href="logout.php">Click here to logout</a>';
//echo "<br>";
// echo '<a href="' .$_SERVER['PHP_SELF']. '?action=change"> Change Password</a>';
?>
<?
include "fns.php";
$action=$_GET['action'];
if($action=="change"){
changepw($_SESSION['username']);
update($newpass,$_SESSION['username']);
}else{
}
?>
</div></td>
</tr>
</table>
<table width="902" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="728" valign="top"><p>
<?php
include "config.php";
$user=($_SESSION['username']);
$tbl_name="user";
$sql="SELECT * FROM $tbl_name WHERE uname = '$user' ";
$result=mysql_query($sql);
$f_name=$_GET['f_name'];
echo $_SESSION['username'];
echo $f_name;
?>