Redirect unique visit with cookies


SUBMITTED BY: Guest

DATE: Oct. 26, 2012, 12:40 p.m.

FORMAT: PHP

SIZE: 457 Bytes

HITS: 1919

  1. <?php
  2. //Checks if there is a cookie
  3. if(isset($_COOKIE["cookiename"])) //if cookie is set
  4. {
  5. header("Location: redirectDOTcom"); //redirect to
  6. }
  7. else
  8. {
  9. setcookie( "cookiename", "something", time()+3600*24, "", "domainname" ); //set cookie name, variable and expiring time
  10. header("Location: redirectuniquehit "); //redirect the unique view
  11. }
  12. ?>

comments powered by Disqus