Easiest Solution For Auto Updating Images Using My Current PHP Script?

by 3 replies
4
Hey Guys,

So I actually have the same script as this site
hxxp://onlinebikinibabes.com
However, it does not automatically update fresh images on it's own. I'd like to place images in a queue, which would then in turn update fresh images several times daily.

Any idea what kind of script/code that would do this?

I'm not a coder or anything so the simpler the better.

Thanks!
#programming #auto #current #easiest #images #php #script #solution #updating
  • Banned
    [DELETED]
    • [1] reply
    • what this mean?

      yeah maybe you can make it random,
      for example,
      make your image filename 1 dot jpg , 2 dot jpg and continue ..

      then you can show it with ->
      PHP Code:
         rand(120); 
      number 20 is your maximum image filename (20 dot jpg),
      then on image source you put that $number dot jpg

      you can make modification, use your imagination
      • [1] reply
  • If you want to have the images autoupdate on REFRESH of page-- simply place the images into an array or database (MySQL, MSSQL) and have the images be echo'd accordingly.

    Similar to what was said above, you could make an array..

    $images = array("images/image1.jpg", "images/image2.jpg", "images/image3.jpg");
    $count = count($images);
    $i = rand(1, $count);
    echo $images[$i];

    This code example would essentially call a random image from your array and display it on the html page.

    Database versions of this would require you create a table for your images, randomly select a row from that table, then echo it accordingly. If you need any help you can always email me at info (at) zhout (dot) com or PM me -- Or if you want, post the code here so someone can tell you where/what to insert.

    Hope this helps!

    If you want the images to autoupdate while still viewing the page, you will need to use a AJAX solution.

Next Topics on Trending Feed