Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // load content-utm.php if the URI contains UTM_keyword
- if (strpos($_SERVER['REQUEST_URI'], "UTM_keyword")){
- // load content-utm.php
- get_template_part( 'content', 'utm' );
- }
- ?>
- <?php
- $uriSegments = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
- // strip out UTM_keyword=
- $uriSegments2 = substr($uriSegments, 12);
- // strip out everything after &UTM_source= including &UTM_source=
- $uriSegments3 = substr($uriSegments2, 0, strpos($uriSegments2, "&UTM_source="));
- $_SESSION['uriName'] = $uriSegments3;
- // create a cookie
- if (strpos($_SERVER['REQUEST_URI'], $uriSegments3)){
- $cookie_name = $uriSegments3;
- $cookie_value = "UTM";
- // make it a session cookie that expires after the browser is closed
- setcookie($cookie_name, $cookie_value, 0, "/");
- }
- // I know how to remove a cookie but I'm not sure how I would remove THIS type of cookie
- ?>
- <?php
- // if the cookie is set
- if (isset($_COOKIE[$uriSegments3])){
- // load content-deluxe-cookie-tracking.php
- get_template_part( 'partners/content', 'deluxe-cookie-tracking' );
- }
- ?>
- <input type="hidden" id="1234567890" name="1234567890" value="<?php echo $uriSegments3 = $_SESSION['uriName']; ?>">
Add Comment
Please, Sign In to add comment