SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple download counter!

    When a user clicks on a link to go to a download site i need to add 1 to a counter and then update the databse. i made it work using a GET variable and then qurying if it was set or not, but, that doesnt work now because when the user clicks on the link it will take them to the page of the download, so if they want apache i direct them to http://www.apache.com (or whatever the addy is) and obviously this wont work if i add "?downloaded=1" at the end.

    I have also tried the html onclick=" <? MY UPDATE QUERY HERE ?> " and copuldnt get it to work

    So how do i 1 to a database when a user clicks on a link without using these methods.

    Thanks in advance
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am not sure whether I fully understood you, but such counters are usually implemented by having an own script which counts the clicks and just then actually does the redirect.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahhhh (dir) yes i only needed to make a slight change what is the syntax to redirect someone to another page??
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  4. #4

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    header('Location: http://www.the-destination-of-your-dreams.com'); 

  5. #5
    SitePoint Wizard
    Join Date
    Dec 2004
    Location
    At My Desk!!
    Posts
    1,642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    once again drzoid u are a great help, thx
    "Am I the only one doing ASP.NET in Delphi(Pascal)?"

  6. #6

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webnoob
    once again drzoid u are a great help, thx
    You are welcome

    Thanks to you for the compliment.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •