Figured out a way to do this, but you need to be careful lest someone exploits pages that are like this.
I started off by using cURL to pull up a page from my server as though a webbrowser was pulling it in. This allowed for EE to parse the page before I captured it into my page:
$user = $this->get_template_vars('user');
session_start();
$strCookie = 'PHPSESSID=' . $_COOKIE['PHPSESSID'] . '; path=/';
session_write_close();
$curl_handle = curl_init('the_page_you_are_pointing_to'.$user['login']);
curl_setopt( $curl_handle, CURLOPT_COOKIE, $strCookie );
curl_exec($curl_handle);
curl_close($curl_handle);
Alright I just left some of my code in there that is unique to my situation. I needed to pass some cookie info (for my own personal use) so you can ignore that portion. What is important is the URL that I replaced with ‘the_page_you_are_pointing_to’. This would be your EE page’s URL and if you’ll notice I appended to the end of it the username of the person. Since I was using aMember in this, the example above is to use aMember’s login name since it matches EE’s login name.
On my EE page, I put this code:
<?
$membername = "{segment_3}";
global $DB;
$sql = "SELECT `member_id` FROM `exp_members` WHERE `username` = '$membername'";
$query = $DB->query($sql);
foreach($query->result as $row)
$memberid = $row['member_id'];
?>
{exp:member:custom_profile_data member_id="<?=$memberid?>"}
{username}
{/exp:member:custom_profile_data}
Now you might say this is pointless since I’m writing the username from EE when I passed in a username in the first place, but it is to illustrate that this works. The username EE spits back should be the same one you gave it, but it actually verified that username. You can use any member profile fields not just {username}.
So the basic summary is I took the username in {segment_3} (it was in my URL) and then I did a lookup in SQL to find it within the EE database. Once I found it, I got the member ID number that is associated with the name.
With the ID number, I simply ran the EE custom_profile_data tag and put in the member ID. This allows me to now be able to fetch ALL the info about this member directly from EE in simple EE tags.
You can do so much with this example. If you wanted, you could technically even have this one page give you only the username, only the member group, only the first name, or whatever else. You just need to use conditional statements and make use of the Segement ability of EE URLs.
Anyway, the usages of this are infinite and I think this is really cool. Hopefully it will help someone or spark some imagination.
P.S. This can be exploited so you need to be very careful. If someone just calls this URL and puts in a valid username, they could potentially get all the information about that user (if you have it displaying from this page). I would suggest more security such as passing in PHP Session information to verify the person is really logged in. I did this in my version of the first block of CURL code but not in the second block of code.