Jump to content

zlatangu

New Members
  • Posts

    6
  • Joined

  • Last visited

zlatangu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a problem, each time that i reload the page i get a different $num variable why is that happening? Can somebody help me, i'm beginner in php. <?php if(isset($_COOKIE["nums"])){ $num = $_COOKIE['nums']; }else{ $num = rand(1,9).date('Y').date('m').date('d').date('h').date('i').date('s'); setcookie("nums",$num, 9999999999); } echo "You have " .$num. " ...."; ?>
  2. Yes what you are saying is true. But for now this was what I needed for my website.
  3. Thanks for help i finally learned how to do that. <?php setcookie("user", time()+3600); ?> <html> <body> <?php if (isset($_COOKIE["user"])) print ("<IMG SRC =image1.PNG>"); else print ("<IMG SRC =image2.png>"); ?> </body> </html>
  4. OK from the following code i got just a blank page <?php /*before any output*/ set the 'visited' cookie /* in your HTML page you'd have this if statement*/ if(isset cookie 'visited') { print ("second") /*output second image*/ } else { print ("first") /*output first image*/ } ?>
  5. No you are not understanding me. I can use cookie for letting the script know that the visitor have been on that page before and than load the second image instead of the first one. Just that I don't know to code in php, can you help me please.
  6. Hi, I want to show one image for the new visitors of my website and another for the returning visitors. What I want to do is that after the visitor reload the page he will see another image instead of the first one.
×
×
  • 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.