Jump to content

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

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 post
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:


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...