The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Is it possible to get MemberID without using inc_header.asp?
I'm working on an uploadthingy with a popup-window. At first I used this link:
<a href=""javascript:openWindow6('ezuploadorig.asp?memid=" & MemberID & ')"">
and then got the memid via Request.Querystring("memid").
But:
after selecting the files I want to upload the popup-window reloads and the memid is lost... If I include the inc_header.asp I get an error as stated in another thread. <
I'm working on an uploadthingy with a popup-window. At first I used this link:
<a href=""javascript:openWindow6('ezuploadorig.asp?memid=" & MemberID & ')"">
and then got the memid via Request.Querystring("memid").
But:
after selecting the files I want to upload the popup-window reloads and the memid is lost... If I include the inc_header.asp I get an error as stated in another thread. <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
2 other ways to retrieve the MemberID without using inc_header.asp.
1. Use inc_header_short.asp instead.
2. Use the getMemberID() function which requires the user name of the member to be passed to it. It is found in inc_func_secure.asp.<
1. Use inc_header_short.asp instead.
Posted
inc_header_short.asp cause the same error as inc_header.asp unfortunately..
I tried getMemberID() but couldn't get it to work.
What's the syntax?
I checked code in topic.asp (I think it was) and tried to use it but it didn't work.
<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
What error is the "same error"?
The syntax is simple as for any other function you calling:
OR<
The syntax is simple as for any other function you calling:
Code:
intMemberID = getMemberID("Davio")Code:
Response.Write "Your Member ID is " & getMemberID("Davio") & vbNewLine
Posted
Okay, so I should use it like this then:
intMemberID = getMemberID("" & strDBNTUsername & "")
I must use a variable because this will tell the code what foldername (the userid) it should upload the files to. <
intMemberID = getMemberID("" & strDBNTUsername & "")
I must use a variable because this will tell the code what foldername (the userid) it should upload the files to. <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
Yes, you can use it like that. Just that, strDBNTUsername is set in inc_header.asp and inc_header_short.asp.
You could put this in your code:strUniqueID is set in config.asp. You could hard code it into your file.<
You could put this in your code:
Code:
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")Code:
strDBNTUserName = Request.Cookies("Snitz00User")("Name")
Posted
heh, no wonder it didn't work then =)
I'll check that out, thank you! <
I'll check that out, thank you! <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
Well, I tried this code:
Dim folder
strDBNTUserName = Request.Cookies("Snitz00User")("Name")
folder = getMemberID("strDBNTUserName")
And got this error:
"ADODB.Recordset error '800a0bb9'. The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another". /inc_func_secure.asp, line 78
I suppose it's because of this line in inc_func_secure.asp
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fUser_Name, "SQLString") & "'"
I guess that I get "strDBNTSQLName" from inc_header.asp also? <
Dim folder
strDBNTUserName = Request.Cookies("Snitz00User")("Name")
folder = getMemberID("strDBNTUserName")
And got this error:
"ADODB.Recordset error '800a0bb9'. The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another". /inc_func_secure.asp, line 78
I suppose it's because of this line in inc_func_secure.asp
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fUser_Name, "SQLString") & "'"
I guess that I get "strDBNTSQLName" from inc_header.asp also? <
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
No, it's from config.asp:
if strAuthType = "db" then
strDBNTSQLName = "M_NAME"
strAutoLogon = "0"
strNTGroups = "0"
else
strDBNTSQLName = "M_USERNAME"
end if
and the M_NAME is from inc_func_secure.asp:
function getMemberName(fUser_Number)
dim strSql
dim rsGetmemberName
'## Forum_SQL
if isNull(fUser_Number) then exit function
strSql = "SELECT M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & cLng(fUser_Number)
set rsGetMemberName = Server.CreateObject("ADODB.Recordset")
rsGetMemberName.open strSql, my_Conn
if rsGetMemberName.EOF or rsGetMemberName.BOF then
getMemberName = ""
else
getMemberName = chkString(rsGetMemberName("M_NAME"),"display")
end if
rsGetMemberName.close
set rsGetMemberName = nothing
end function
and that function won't work since I don't have the "fUser_Number".
Am I wrong? (I hope so..)
<
if strAuthType = "db" then
strDBNTSQLName = "M_NAME"
strAutoLogon = "0"
strNTGroups = "0"
else
strDBNTSQLName = "M_USERNAME"
end if
and the M_NAME is from inc_func_secure.asp:
function getMemberName(fUser_Number)
dim strSql
dim rsGetmemberName
'## Forum_SQL
if isNull(fUser_Number) then exit function
strSql = "SELECT M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE MEMBER_ID = " & cLng(fUser_Number)
set rsGetMemberName = Server.CreateObject("ADODB.Recordset")
rsGetMemberName.open strSql, my_Conn
if rsGetMemberName.EOF or rsGetMemberName.BOF then
getMemberName = ""
else
getMemberName = chkString(rsGetMemberName("M_NAME"),"display")
end if
rsGetMemberName.close
set rsGetMemberName = nothing
end function
and that function won't work since I don't have the "fUser_Number".
Am I wrong? (I hope so..)
<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Posted
Oops. Brain didn't catch that. Hmmm
Easiest fix would be to include config.asp. Or take out the variables out of config.asp and put it in your file. And copy the function into your file. Replacing the variables with the hard coded values.
Basically you will have to get the user name from their cookie, then search for their ID that matches their user name.<
Easiest fix would be to include config.asp. Or take out the variables out of config.asp and put it in your file. And copy the function into your file. Replacing the variables with the hard coded values.
Basically you will have to get the user name from their cookie, then search for their ID that matches their user name.<
Posted
I already have config.asp included =)
I still get the same error if I try this:
folder = getMemberID("strDBNTUserName")
Why won't it work? The complete code is here:
http://www.gotlandrace.se/tabort/ezuploadorig.txt
<
I still get the same error if I try this:
folder = getMemberID("strDBNTUserName")
Why won't it work? The complete code is here:
http://www.gotlandrace.se/tabort/ezuploadorig.txt
<
/Tribaliztic
- www.gotlandrace.se -
- www.gotlandrace.se -
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...