rdkd1970 Posted June 11, 2011 Share Posted June 11, 2011 I am trying to click on another members profile and view theirs with the add as friend or remove as friend links but it keeps coming back to my own profile. I believe it is because of the $_SESSION[sESS_ID] I have in the $sqlArray. What am I suppose to use to get the other members profile when I click on it. $friendLink = ""; $the_chat_form = ""; $iFriend_array = ""; if (isset($_SESSION['SESS_ID']) && $_SESSION['SESS_ID'] != $id) { // If SESSION id :-\ is set, AND it does not equal the profile owner's ID // SQL Query the friend array for the logged in viewer of this profile if not the owner $sqlArray = mysql_query("SELECT friend_array FROM myMembers WHERE id='" . $_SESSION['SESS_ID'] ."' LIMIT 1"); while($row=mysql_fetch_array($sqlArray)) { $iFriend_array = $row["friend_array"]; } $iFriend_array = explode(",", $iFriend_array); if (in_array($id, $iFriend_array)) { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'remove_friend\');">Remove Friend</a>'; } else { $friendLink = '<a href="#" onclick="return false" onmousedown="javascript:toggleInteractContainers(\'add_friend\');">Add as Friend</a>'; } This is the javascript I am using. It works to open the friend request in my profile but it is not clicking on the other profile and letting me view them it goes back to my profile. function toggleInteractContainers(x) { if ($('#'+x).is(":hidden")) { $('#'+x).slideDown(200); } else { $('#'+x).hide(); } $('.interactContainers').hide(); } function toggleViewAllFriends(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } function toggleViewMap(x) { if ($('#'+x).is(":hidden")) { $('#'+x).fadeIn(200); } else { $('#'+x).fadeOut(200); } } // Friend adding and accepting stuff function addAsFriend(a,b) { var friendRequestURL = "scripts_for_profile/request_as_friend.php"; $("#add_friend_loader").show(); $.post(friendRequestURL,{ request: "requestFriendship", mem1: a, mem2: b } ,function(data) { $("#add_friend").html(data).show().fadeOut(12000); }); } function acceptFriendRequest (x) { var friendRequestURL = "scripts_for_profile/request_as_friend.php"; $.post(friendRequestURL,{ request: "acceptFriend", reqID: x } ,function(data) { $("#req"+x).html(data).show(); }); } function denyFriendRequest (x) { var friendRequestURL = "scripts_for_profile/request_as_friend.php"; $.post(friendRequestURL,{ request: "denyFriend", reqID: x } ,function(data) { $("#req"+x).html(data).show(); }); } // End Friend adding and accepting stuff // Friend removal stuff function removeAsFriend(a,b) { var friendRequestURL = "scripts_for_profile/request_as_friend.php"; $("#remove_friend_loader").show(); $.post(friendRequestURL,{ request: "removeFriendship", mem1: a, mem2: b } ,function(data) { $("#remove_friend").html(data).show().fadeOut(12000); }); } Should I be adding another section of the javascript for just adding a friend because the one that I have for adding a friend actually is allowing me to view my own profile and access the friend request but ofcourse nothing is in it as we can not view another profile. Quote Link to comment https://forums.phpfreaks.com/topic/239061-moved-not-able-to-view-friend-profile/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.