Hello!
I am new to SharePoint and I have the need to display the current username so we can pass it as a token for another website.
e.g. www.test.com?ID=username(SharePoint)
I used this code and placed it on the Content Editor WebPart (if i sound so clueless please pardon me, i'm still trying to learn this - i am/was a coldfusion developer) and i pretty much just got a blank screen:
<%
Dim UserID
Dim UserName
Dim UserCustomName
Dim NeedsToEnterInfo
UserID = request.servervariables("LOGON_USER")
If UserID <> "" Then
If Instr(UserID,"\") > 0 Then
UserName = StrReverse(Left(StrReverse
(UserID),Instr(StrReverse(UserID),"\")-1))
Else
UserName = UserID
End If
Else
UserName = ""
End If
UserCustomName = ""
%>
Any assistance would be greatly appreciated! Thanks :)