How to jump to a profile by clicking on a hyperlink?

Discussion in 'Java' started by silversurface, Apr 9, 2010.

  1. silversurface

    silversurface New Member

    Joined:
    Feb 18, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    You don't need to parse the text of the hyperlink but what you can do is make that link read something like this

    <A href="user.php?member=somename">somename</a>

    and your user.php file should show the profile of the member with somaname
     
  3. silversurface

    silversurface New Member

    Joined:
    Feb 18, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    But am using jsp ..possible there too? k will try now
     
  4. silversurface

    silversurface New Member

    Joined:
    Feb 18, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Description: Basically the first page has display of links to all professors. These are present in a form as input type named emailz in a loop for display. Its in a loop so to fetch the diff links we can use String emailz[ ]= request.getParamaterValues(emailz).

    Which is working. Now in the next page while displayin each link i associate the email[z] element where z is an index to the anchor link like this :

    PHP:
     <td> <a href="fomname.jsp?button=Info&email= <%= emailz[z] %>"><%= resultset.getString(3) %> </a> </td
    When i submit in the url of the next page i get --- "formname.jsp?button=Info&email= girish@site.com " where i had clicked on girish's link

    Problem: But the query in this page is designed to display the profile of whose session variable email exists. Which is of the logged in user. Even if i change this i 'd like to find a way of using a session variable as an array that can hold the values of email[z] for diff values of z and then compare this session variable with email field of database and get the requested profile. Meaning at present i can only set the session variable to one link not to all. So is this possible? using session variable as an array?
     
  5. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    It is nothing to do with the programming language and if you can get the content of the user based on some value (be it username/email/id) you can just do the rest with HTML.

    Now about the result page you are talking is for viewing the self profile and not other profile.

    You have to have 2 pages.

    1. Self profile
    2. Other profile.

    In live sites its the same page with different parameters but actually there is lot of difference.

    As an example

    You see your profile at G4Ef and my profile and you will see some difference.

    You have option to edit some of your fields but not mine.

    So you have to have your profile page intelligent enough to work only for query string and if query string of email is missing use the session variable.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice