display user account name on CustPref.asp |
Post Reply |
Author | |
Nothing
Newbie Joined: 02-November-2005 Location: Canada Status: Offline Points: 0 |
Post Options
Thanks(0)
Posted: 02-November-2005 at 4:18am |
hello all. i'm trying to display the user's account name when they enter the CustPref.asp page. I'm trying to say "welcome back <%=session("customerName")%>", but this only works if they visit the "edit Personal Information" page to set the session customerName. any ideas? n0thing |
|
Nothing
Newbie Joined: 02-November-2005 Location: Canada Status: Offline Points: 0 |
Post Options
Thanks(0)
|
got it. <% i added the above code to the CustPref.asp page and used "<%=session("customerName")%>" to display the account name where needed. later! |
|
blackdesk
Newbie Joined: 23-November-2005 Location: United States Status: Offline Points: 0 |
Post Options
Thanks(0)
|
hi nothing -
can you tell me where you pasted the code? thanks! b |
|
netprofits
Certified ProductCart Developers Joined: 05-January-2006 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
Custvb.asp is called from custva.asp which is where a customer logs in. In Custvb.asp, around line 114, the customer login has been validated and the customer name is loaded in the record set. You could just add a line like: Session("CustomerName") = rsCustObj("name") & " " & rsCustObj("lastName") Then you can use Session("CustomerName") to display the customer's name in other pages. To be safe, you could test that Session("CustomerName") is not null before displaying a message with the name. |
|
Aeon
Newbie Joined: 18-June-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
How do I display the customer name on header.asp?
how do I reference to it? |
|
netprofits
Certified ProductCart Developers Joined: 05-January-2006 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
First the customer has to login so you can set the session variables as described in the posts above. Once the session variables are set, you can display them anywhere. You would need to check if the values are set before trying to display them. In the header.asp file, use code like:
|
|
Aeon
Newbie Joined: 18-June-2006 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
I still can't figure it out. How do I make it appear on header.asp?
This is my current code <div id="myAccount">Hi <% ' Display Name of customer if logged in if session("idCustomer")="0" or session("idCustomer")="" then%> Guest, <% else %> <strong><%=session("customerName")%></strong& gt;, <a href="custPref.asp">Your Account</a> <% end if %> <% ' If the customer is not an affiliate and is not logged in ' show a link to the registration page. if session("idCustomer")="0" or session("idCustomer")="" then%> <a href="custPref.asp">Login</a> &l t;span style="color: #FF0000">/</span> <a href="custPref.asp">Register</a></div> <% else ' If the Wish List feature is active, show a link to it if (scWL="-1") or ((scBTO=1) and (iBTOQuote=1)) then%> <a href="custPref.asp">My Account</a> <span style="color: #FF0000">/</span> <a href="Custquotesview.asp">Wishlist</a> &am p;nbsp;<span style="color: #FF0000">/</span> <a href="CustLO.asp">Log Out</a></div> <% end if %> <% end if %> <!-- End My Account --> </div> |
|
netprofits
Certified ProductCart Developers Joined: 05-January-2006 Location: United States Status: Offline Points: 22 |
Post Options
Thanks(0)
|
You header.asp code looks correct. Are you setting session("customerName") in the routine where a customer logs in as described in the post above from May 18th? Are you getting an error or is it just not displaying the name?
|
|
Rob-CFLHD
Newbie Joined: 20-April-2007 Status: Offline Points: 0 |
Post Options
Thanks(0)
|
I got this to work, but only after the user visits their information page. it will just say Hi and not show a name until they visit their information page. It seems that it is querying the pages, not the database for the user name. How could this be fixed?
<div id="myAccount"> |
|
BlackReefDesigns
Newbie Joined: 28-May-2008 Location: San Diego, CA Status: Offline Points: 8 |
Post Options
Thanks(0)
|
I wonder how difficult this would be to setup first name only?
ex: instead of 'Welcome Back Jeff Schwartz | Logout' It simply says 'Welcome Jeff | Logout Here is the current code I am using:
|
|
Joe S.
BlackReef.net |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |