Jump to content

rodd

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rodd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Well that certainly seems to be doing the trick Andy .....phew. I think theres maybe a medal waiting for you in the HR department lol I've deleted all of my temporary files/cache then revisited the site and it's giving me a different plumber everytime now. Could anyone confirm this?
  2. Thanks Darkwater. Basically my Boss wants me to create a page that will show a different plumbers details every time a user reaches the page. He has 5 clients, and wants to rotate there contact details so they all given equal exposure on the site. He's a challenging boss.... to say the least ( although i could say he's a **** too...lol)
  3. The main thing is that every user sees a different image. It doesnt matter if user A refreshes and sees the same image again, providing user B doesnt see the same image as A did the FIRST time entering the site. Thanks again.
  4. Hi, here is the RANDOM code ive been using. Only a few images maximum 5. <?php $img = array(); $img[] = '<img src="img1.jpg" />'; $img[] = '<img src="img2.jpg" />'; $img[] = '<img src="img3.jpg" />'; $img[] = '<img src="img4.jpg" />'; $img[] = '<img src="img5.jpg" />'; $max = count($img) - 1; $count = rand(0,$max); echo $img[$count]; ?>
  5. thanks f1 fan, How would i begin to do that, im pretty new to all this. Is there a simple way?
  6. Hi thanks for the replies, I tried a random grab sequence but it tended to stick on the same image to often. Refreshing the page would often show image 4 twice in a row followed by 2 twice etc.... i need things to be more equal as these are potential clients phone numbers. Thanks.
  7. Hi, I've already posted my problem before and i thought it was solved, but later realised not hence a repost. Currently i have a page where i want to display a different image every time a "NEW" user visits the page. So.....user 1 sees image 1 user 2 sees image 2 user 3 sees image 3 etc etc....(all users from different locations) At the moment when i refresh the page it works as i want it too. ie i see image 1 then after a refresh i see image to and so on. BUT......When i clear my temp files it just takes me back to image 1 everytime. Which obviously means every visitor will land on image 1 too as it is the start of a session. Is there a way to store cookies/sessions on the server to display a different image instead? I don't know if im asking the impossible or not. I'm certainly glad for the help. heres the site, www.plumbersnottingham.co.uk Heres the code i've been using. <?php $img = array(); $img[] = '<img src="PLUMBER1.jpg" />'; $img[] = '<img src="PLUMBER2.jpg" />'; $img[] = '<img src="PLUMBER3.jpg" />'; $img[] = '<img src="PLUMBER4.jpg" />'; $img[] = '<img src="PLUMBER5.jpg" />'; if(!isset($_SESSION['image_display'])){ $_SESSION['image_display'] = 0; }else{ $_SESSION['image_display']++; if($_SESSION['image_display'] > count($img)-1){ $_SESSION['image_display'] = 0; } } echo $img[$_SESSION['image_display']]; ?> Thanks
  8. Wow, thanks that works absolutley brilliantly.... you are a star!!!! Very much appreciated...
  9. sorry heres the code i have been using <?php $img = array(); $img[] = '<img src="PLUMBER1.jpg" />'; $img[] = '<img src="PLUMBER2.jpg" />'; $img[] = '<img src="PLUMBER3.jpg" />'; $img[] = '<img src="PLUMBER4.jpg" />'; $img[] = '<img src="PLUMBER5.jpg" />'; $max = count($img) - 1; $count = rand(0,$max); echo $img[$count]; ?>
  10. Hi im really new to PHP and just discovering how useful it is. Great site by the way. What i am trying to do is each time a visitor comes to the site they see a different image, (only one image at a time) at the moment it is random and sometimes it falls on the same image 2 or 3 times in a row before switching. So i figured the best way around that would be to have the image order in sequence (ie, 1,2,3,3,5) . Then when it gets to last image it loops back to image 1 again and so on. Basically, is there an alternative to the "rand" attribute that will make a set of 5 images display in order rather than randomly. Heres the site www.plumbersnottingham.co.uk Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.