thanx for the reply again mate, i tried both methods. php method was just as if it was an ordinary link, no window and when i tried escaping php all together i got no response from page (just blank). the aim is to have the link visible when viewing other peoples profile, but not visible when viewing own profile.
Here is the entire code:
PHP Code:
<?
/* Requested Username error checking */
$req_user = trim($_GET['user']);
if(!$req_user || strlen($req_user) == 0 ||
!eregi("^([0-9a-z])+$", $req_user) ||
!$database->usernameTaken($req_user)){
die("Username not registered");
}
/* Logged in user viewing own account */
if(strcmp($session->username,$req_user) == 0){
echo "<h1>My Account</h1>";
}
/* Visitor not viewing own account */
else{
echo "<h1>User Info</h1>";
echo "[<a href=\"send.php\" onClick=\"NewWindow(this.href,'name','600','400','yes');return false\">Send Message</a>]<br><br>";
}
/* Display requested user information */
$req_user_info = $database->getUserInfo($req_user);
/* Username */
echo "<b>Username:</b> ".$req_user_info['username']."<br><br>";
/* Email */
echo "<b>Email:</b> ".$req_user_info['email']."<br><br>";
$timestamp = $req_user_info['timestamp'];
echo "<b>Last Active:</b> ".date('jS F Y \a\\t g.ia', $timestamp)." <br><br>";
/**
* Note: when you add your own fields to the users table
* to hold more information, like homepage, location, etc.
* they can be easily accessed by the user info array.
*
* $session->user_info['location']; (for logged in users)
*
* ..and for this page,
*
* $req_user_info['location']; (for any user)
*/
/* If logged in user viewing own account, give link to edit */
if(strcmp($session->username,$req_user) == 0){
echo "<br><a href=\"useredit.php\">Edit Account Information</a><br>";
}
/* Link back to main */
echo "<br>Back To [<a href=\"index.php\">Main</a>]<br>";
?>
Bookmarks