Jump to content

Insert sesion of user and other id into table , when selected


kastellu
 Share

Recommended Posts

Hello,I have one question. How I could create a page with objects (for example pictures) and when a user (that was registered and at the moment he is loged in) would click and look at the picture , his session or id of that user and id of selected picture would be inserted into table. So at that moment i would get information who was looking at that picture.Any examples?Best regards,K

Link to comment
Share on other sites

Rather than linking directly to the picture:

<a href="image1.jpg"><img src="image1_thumb.jpg" /></a>

You might consider building a image loader page that you'd reference like this:

<a href="imageloader.asp?path=image1.jpg"><img src="image1_thumb.jpg" /></a>

Then, on that imageloader page, you could check the session to get the user ID and then write a record to the database table that includes the user ID and the image path. Once that operation was complete, you could redirect the user to the image:

Response.Redirect(imagepath)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...