40 users online (0 members and 40 guests)  

Thread: onClick on php?


  Results 1 to 2 of 2

Related

  1. Onclick menu - Help    Forum: Javascript Forum
    Replies: 10
  2. onClick and <iframe>    Forum: HTML Forum
    Replies: 4
  3. Onclick Listbox    Forum: Javascript Forum
    Replies: 2
  4. onClick problem    Forum: Javascript Forum
    Replies: 1
  5. onclick help    Forum: Javascript Forum
    Replies: 3
  1. #1
    freaky's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2005
    Posts
    2

    onClick on php?

    Hi ..
    I'd like to know is there any function in php that act like "onClick" on Javascript?
    I'd like to count how many times a link has been being clicked by visitor, and I don't wan't have a popup window..
    Thank you & sorry my bad english
    Last edited by HTML; 01-05-2005 at 08:36 AM.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    'Fraid not. PHP is server-side, JavaScript is Client-side. So you can capture client events in JavaScript, but the server can't tell who is clicking what.

    What you can do instead is to write a simple script that counts for you. You then redirect the user after the record has been taken. So instead of linking to 'page.html' you link to 'counter.php?page=page.html' or if you prefer use ID's, eg 'counter.php?page=4'
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread