Well it looks as though you've set up your system to protect profiles from users who have not logged in. All you need to do if something like this:
Get user ids and usernames from DB:
<a href="www.example.com/profile.php?id=231">ardav's profile</a>
<a href="www.example.com/profile.php?id=706">greenelf's profile</a>
The in your profile.php page:
if(isset($_GET['id'])){
$edit = false;
$id = intval($_POST['id']);
if(isset($_SESSION['login_id']) && $id == $_SESSION['login_id']){
$edit = true;
}
$result = ... (etc)
}
Now you can control the output based on the value of $edit.
diafol
Keep Smiling
10,672 posts since Oct 2006
Reputation Points: 1,632
Solved Threads: 1,514
Skill Endorsements: 57