Guest User

Untitled

a guest
Mar 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <?php
  2. // load content-utm.php if the URI contains UTM_keyword
  3. if (strpos($_SERVER['REQUEST_URI'], "UTM_keyword")){
  4. // load content-utm.php
  5. get_template_part( 'content', 'utm' );
  6. }
  7. ?>
  8.  
  9. <?php
  10. $uriSegments = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
  11. // strip out UTM_keyword=
  12. $uriSegments2 = substr($uriSegments, 12);
  13. // strip out everything after &UTM_source= including &UTM_source=
  14. $uriSegments3 = substr($uriSegments2, 0, strpos($uriSegments2, "&UTM_source="));
  15. $_SESSION['uriName'] = $uriSegments3;
  16. // create a cookie
  17. if (strpos($_SERVER['REQUEST_URI'], $uriSegments3)){
  18. $cookie_name = $uriSegments3;
  19. $cookie_value = "UTM";
  20. // make it a session cookie that expires after the browser is closed
  21. setcookie($cookie_name, $cookie_value, 0, "/");
  22. }
  23. // I know how to remove a cookie but I'm not sure how I would remove THIS type of cookie
  24. ?>
  25.  
  26. <?php
  27. // if the cookie is set
  28. if (isset($_COOKIE[$uriSegments3])){
  29. // load content-deluxe-cookie-tracking.php
  30. get_template_part( 'partners/content', 'deluxe-cookie-tracking' );
  31. }
  32. ?>
  33.  
  34. <input type="hidden" id="1234567890" name="1234567890" value="<?php echo $uriSegments3 = $_SESSION['uriName']; ?>">
Add Comment
Please, Sign In to add comment