Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2012
    Posts
    52
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Click counter on an image

    Hi, everyone. I am new to server side programming and I face a challenge while i'm trying to develop a graphical password authentication system.

    In my system, I wish to record the click counts of an user on his password(it's a set of images).

    During enrollment, the user will set the click count(s) on 5 images and the click count(s) of each image will be recorded in the database(phpmyadmin).

    When the user wants to login, the 5 images will be displayed, therefore, the user will need to click on each image with the correct click count to login.

    I am wondering is it possible to do so ? I tried to search for some information online, but all i found is webpage or links click counter only. Can anyone please provide me some clue or guide on how can i do this ?

    Thanks in advance. I appreciate your help a lots ^.^

  • #2
    New Coder
    Join Date
    Aug 2010
    Location
    myeik
    Posts
    81
    Thanks
    6
    Thanked 5 Times in 5 Posts
    PHP Code:
    $image $_POST['image'];
    $sql=mysql_query("SELECT image form table_name");
    $row=mysql_fetch_array($sql);
    $rowimg$row['image'];

    if(
    $image == "$rowimg"){
    echo 
    "login";
    }else{
    echo 
    "Wrong image";

    is it ?
    Last edited by minkoko; 01-05-2013 at 04:40 PM.

  • #3
    New Coder
    Join Date
    Dec 2012
    Location
    England
    Posts
    20
    Thanks
    0
    Thanked 4 Times in 4 Posts
    If you want to count clicks on image and send those clicks later to server-side script then the best choice is to use JavaScript. You should listen to "click" event of every single image. On click event you should increment clicks count of an image event occured on.

    What I would do is create hidden inputs with default value of 0, each for every image. When user clicks an image, JavaScript increments it's corresponding input value. Values of those inputs will be sent together with login form so you can access them in PHP.


  •  

    Posting Permissions

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