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

silversurface's Avatar, Join Date: Feb 2010
Light Poster
Quote:
Basically creating a website for our comp dept in college..
Now consider a scenario : when a teacher or student logs in and is viewing someone else's blog ..when he clicks on the creator of the blog "which s a hyperlink" he should jump to the profile page of that user..How to do this?

Problem: Should i use session variables for this? I have created two session variables which are created at the time of login for the current user called email[this is unique] and usertype [teacher/student]

Suggested solution: Somehow i need to find a way to retrieve the text[email] printed within the anchor tag and make a search through the database to find a match with email of any user registered so that their profile can be displayed.

Anyone has any idea?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
silversurface's Avatar, Join Date: Feb 2010
Light Poster
But am using jsp ..possible there too? k will try now
silversurface's Avatar, Join Date: Feb 2010
Light Poster
Quote:
Originally Posted by shabbir View Post
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
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 Code:
 <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?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.