Jump to content

Recommended Posts

I wanna incorporate into my site where members can view each others profiles.

 

I've got a page a members pages that lists all members.

<?php
include 'dbc.php';
page_protect();
//----------------------------------------
//mySQL Connection Start
mysql_connect ("localhost","username","password");
mysql_select_db ("sports");
//mySQL Connection End


function printMembersList(){
//Get User id #'s
$sql="SELECT  user_name FROM users WHERE user_profile=1";
    $result=mysql_query($sql);	
   while($row = mysql_fetch_object($result))
   {
    $ids[] = $row->user_name;
   }	
//Done Getting User id #'s

for($i=0; $i< count($ids); $i++) {
echo '
<tr>
<td>'.$ids[$i].'</td>
</tr>
';

if ( (($i+1) % 6) == 0 ) echo $newrow="</tr><tr>"; // change 6 to 8 and see
}

}

?>

 

I can call the function printMembersList and it print a table row with the members user names.

What i want someone to explain to me is how to put a link on each name to send them to view their profile.

 

I've got the page i want it to go to created but i don't have a clues on how to put them together.

below is the code for the page i want it to got to.

 

<?php
include 'dbc.php';
page_protect();
//----------------------------------------
//mySQL Connection 

mysql_connect ("localhost","username","password");
mysql_select_db ("sports");

//--------------------------------------------------------------------------------------

$member_clicked = ; //THE SELECTED USER ON PREVIOUS PAGE (Member List Page). 

$rs_settings = mysql_query("select * from users where id='$member_clicked'");

//--------------------------------------------------------------------------------------
?>

 

If someone could point me in the right direction on how to do this i would appreciate it.

Link to comment
https://forums.phpfreaks.com/topic/208417-question/
Share on other sites

i'm asking that an then on the other page how will the linked to page know which link was clicked?

 

what do i need to put in the second page right here...


$member_clicked = ;//The Selected User on Previous (Member List Page). !!!!!!!HERE!!!!!!!<-----

$rs_settings = mysql_query("select * from users where id='$member_clicked'");
?>

 

Thats what i don't have a clue on.

Link to comment
https://forums.phpfreaks.com/topic/208417-question/#findComment-1089123
Share on other sites

Closer but still no cigar!

 

Now from the members page when you click on a name yes in the address bar it goes to (http://sports.nodinelandscaping.com/phplogin_v2.3/members_profile.php?id=Lucky2710)

 

 

Lucky2710 is the user clicked that parts fine, but once its there the 2nd page aint pulling the user (ie. Lucky2710)  to display the profile specific stuff on the page.

 

So???!!! I'm still stuck! Dangit!!!

Link to comment
https://forums.phpfreaks.com/topic/208417-question/#findComment-1089238
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.