This is a discussion on "Insert to db when clicking a link." within the Classic ASP section. This forum, and the thread "Insert to db when clicking a link. are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Insert to db when clicking a link.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Insert to db when clicking a link.
Hi, first post so be gentle!
I am doing a site for a friend that is basically a linking site. What he wants is for registered individuals to be able to click through image links, when signed in, but be able to track which links they visited. I, so far, have the login via the home page creating a session called username (original I know!) and was looking at turning each image link into an image submit button. Clicking the image causes an insert statement to run putting the session name into the database. My question (at last) is; on a response.redirect is it possible to declare the target="_blank" as well? if not any other way to open the link in a new window and do the insert? |
|
|
|
|||
|
Nope, thats not possible. One option is not to use Resonse.Redirect, but instead Response.Write some javascript which opens a new window which contains a page which does the insert.
|
|
|||
|
hmm didn't think it would be. Thanks.
Now I have the problem of convincing Dreamweaver that that is the case. It writes it's own strange code for an insert that looks like this:
|
|
|||
|
lol, don't use DW to write ASP and expect to then modify it yourself, doesn't work that way i'm afraid.
I'd write the ASP yourself. All you want it the for the link to pass something back to the page, either in the session or maybe the querystring so an image link might go to /page.asp?img=1&clicked=true
|
|
|||
|
Or even better, have a page called redirect.asp which all these images link to and pass a url variable.
Like redirect.asp?url=http://www.google.com then log the link and session("username") when it's clicked. Then for your image links just link them to the redirect and have your target="_blank" |
![]() |
| Tags |
| insert, clicking, link |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make a div become visible on clicking a link? | snappy | Web Page Design | 12 | Jun 11th, 2008 19:25 |
| Changing a session variable when clicking a link? | Crow555 | Classic ASP | 0 | May 15th, 2008 12:22 |
| How do I insert link in to text | Karenm | Starting Out | 2 | Jun 12th, 2007 17:00 |
| leave link underlined after clicking | monfu | Web Page Design | 9 | May 29th, 2006 17:47 |
| HELP, ASAP- Lag time when clicking on link... how can I fix?? | Snapa02 | Web Page Design | 6 | Apr 26th, 2006 00:18 |