1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Users able to see there own photo after login

Discussion in 'C#' started by bagfull, Apr 21, 2011.

  1. #1
    Hi,
    i m working on asp.net with c#.

    i have 4 users .
    1. Admin
    2. Employee
    3. Student
    4. Guest User

    1,2,3 can login into my site. whenever particular admin or employee or student logins of any then it shld show there photo in there profile...

    so after login session.. i want show there own photo.. and registration are done by admin so at at that time student and employee photos are uploaded.

    so plz tell me what to do ? i have no idea abt it... if possilbe give me some code. :)

    thanks
     
    bagfull, Apr 21, 2011 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Depending what level of security you want on the photos, simply name the photos as username.jpg and then when they're logged in you have their username and therefore can put the right image there
     
    AstarothSolutions, Apr 22, 2011 IP
  3. bagfull

    bagfull Well-Known Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #3
    but what if the username of image is same of any 2 student ?? then ??
     
    bagfull, Apr 23, 2011 IP
  4. bibinsmk

    bibinsmk Active Member

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    User name will not be duplicated.
     
    bibinsmk, Apr 25, 2011 IP
  5. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Usernames have to be a unique identifier, most also don't allow users to change their usernames but if you did you would need to ensure the filename is also changed at the same time.

    You would discard the original filename of the uploaded file as it risks duplication.
     
    AstarothSolutions, Apr 26, 2011 IP