This topic is locked

How to add user picture to the header based on the userID

12/2/2009 10:58:50 AM
ASPRunnerPro General questions
D
dunga author

hi,

I have a project where a personalized user information has to be displayed either on the header.asp file based on the UserID.
I have setup the users table as following:
ID -primary key

FirstName

LastName

Login - this is my UserID

Password

Picture

Info - memo this is short info about user.
the project requires listing:
FirstName/LastName, picture and info at all times when user is logged in either in the header(?) or somewhere on the _list.asp or any other pages(like _add.asp, edit.asp.

Thank you

J
Jane 12/3/2009

Hi,
Unfortunately Visual Editor do not support VB code.
You can edit generated include/header.asp file directly

Here is a sample:

<!--#include file="dbcommon.asp"-->

<%

str = "Select FirstName, LastName from TableName where LoginID='" & Session("UserID") & "'"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

Response.write "Name: " & rstmp("FirstName") & " " & rstmp("LastName")

rstmp.close

set rstmp=nothing

%>
D
dunga author 12/3/2009

Thank you Jane.