Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Location
    UK
    Posts
    1,135

    PHP click to change ?

    Hello, just another quick PHP question here:

    How would I go about making a small script whereby:

    An image is shown, based on what is in the database.

    So, image1 is currently being shown, as is referenced as "1" in the mysql db. I click on the image. Image changes to image2, and is updated in the db as "2". The same for 3, however,when I click on the 3rd image, it cycles back to image 1.

    I'm not sure if that's clear enough for you :|
    Shamil Nunhuck, - Radon Systems Limited
    VPS + Dedicated Server Hosting and Management
    vBulletin / XenForo Hosting and Services
    Server / Website Consultation

  2. #2
    Join Date
    May 2008
    Posts
    117
    Make php script that displays images dynamically by using GET.

  3. #3
    Join Date
    Apr 2009
    Location
    localhost
    Posts
    175
    I would suggest you to use session variable for handling this. So that when session starts it will be 1 by default and for each click it changes the session variable using a counter and if it reaches 3 it resets the variable to 1 again.

    updating db and getting it back will make unwanted query to the DB and obviously the loading time ...

Posting Permissions

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