i2-Services, Inc. Forums

Full Version: Displaying Fields after Log In
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have modified the login_box.php file to display the users email address once they have logged in.  What I would LIKE to do is display some of the other information from the mm_users table.

Here is the code that displays the users email address under an image file, with available options for the logged in user:

Code:
////////////////////////////////////////////////////////////////////////////////////////////////////
// User Logged In --> Show Logged in Table
////////////////////////////////////////////////////////////////////////////////////////////////////

if($_SESSION[email_address] && $_SESSION[pass]) {
   echo "
       <a href=\"request.php\"><img src=\"images/reqserv.gif\" border=\"0\" /></a>
       <div align=\"center\">
       $_SESSION[email_address]
       </div>
         <ul>
             <li><a href=\"php_mm/control_panel.php\">My Account</a></li>
             <li><a href=\"members/mysubs.php?u_id=$_COOKIE[email_address]\">My Submissions</a>
             </li>
             <li><a href=\"php_mm/control_panel.php?logoff=1&redirect=\">Log Off</a></li>
         </ul>
   ";
}


Any tips on how I can either create new cookies when the user logs in using other fields in the mm_user table, or how I can use the ID field as the URL parameter being passed on the "My Submissions" linked - rather than the email_address, would be greatly appreciated.

By the way, I am quite pleased with how easy this program integrated into my application.  Thanks for your continued guidance.

Glad things are going well. What fields are you looking to pull in? You can call all custom fields via the session variable:

$_SESSION[mm_FIELD1]

to

$_SESSION[mm_FIELD20]

as well as:

$_SESSION[mm_name]
$_SESSION[mm_username]
$_SESSION[mm_expires]

Let me know what you're looking to pull in if the above does not get you the desired results.

Thanks!
i2
Thanks. That should do it for me. I knew it had to be a simple solution, but I was drawing a blank. Smile
Any way to get the ID field?

weidemannia Wrote:
Any way to get the ID field?


Unfortunately that is not currently set into the session in the current version.

Perhaps you can offer me a different approach to solving my dilema.

I want to use the member's ID field as a persistent, unique number to follow all of the documents and records they create on the site. Knowing they can change the email or username, I do not want to have to go back and make global database edits to keep things consistent.
As an alternative approach, is there a way for me to automatically copy the value from the ID field into one of the custom fields?

weidemannia Wrote:
As an alternative approach, is there a way for me to automatically copy the value from the ID field into one of the custom fields?


Submit a support ticket & I'll get you an update so the ID is set in the session for you.

Sound good?

i2-Services, Inc. Wrote:

weidemannia Wrote:
As an alternative approach, is there a way for me to automatically copy the value from the ID field into one of the custom fields?


Submit a support ticket & I'll get you an update so the ID is set in the session for you.

Sound good?

Sounds great.

In the meantime, I implemented a temporary fix that passes the username as a URL parameter to a utility page that does a quick lookup in the users table, and then performs an immediate redirect to the target page using the ID.

Wow. You guys are fantastic! I submitted a service ticket, and within minutes I received the automated email informing me that the ticket had been received, and AT THE SAME TIME, I received another email with the FIX attached! Updated the file and it works like a charm.

Microsoft should take some lessons from your customer-focused approach to support.
Reference URL's