Advertisement
keysle

job interview sample code #001

Jul 2nd, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.30 KB | None | 0 0
  1. <?php
  2. if ( 0==strlen($_SESSION['trial']) || isset($_GET['type']) ){
  3.     if ("special"==$_GET['type']) {
  4.         $getSpecial="special";
  5.         $trial = "free";
  6.     }else{
  7.         $getSpecial="offer";
  8.         $trial = "offer";
  9.     }
  10. }else{
  11.     $trial = $_SESSION['trial'];
  12.     if ("free"==$trial)
  13.         $getSpecial="special";
  14. }
  15. $_SESSION['trial'] = $trial;
  16.  
  17. switch ($_GET['plan']){
  18.     case "score":
  19.         $plan = 0;
  20.     break;
  21.     case "credit":
  22.         $plan = 0;
  23.     break;
  24.     case "advantage":
  25.         $plan = 0;
  26.     break;
  27.     case "identity":
  28.         $plan = 1;
  29.     break;
  30.     case "premier":
  31.         $plan = 1;
  32.     break;
  33.     case "family":
  34.         $plan = 2;
  35.     break;
  36.     default:
  37.         $plan = 0;
  38. }
  39.  
  40. $_SESSION['plan'] = $plan;
  41.  
  42. $onDev = 0;
  43. if ( strstr($_SERVER['HTTP_HOST'], "dev") ){
  44.     $onDev = 1;
  45. }
  46.  
  47. if ( !strstr($_SERVER['HTTP_HOST'], "equifaxoffer") && !strstr($_SERVER['HTTP_HOST'], "myequifaxcreditreport") && ($_GET['plan']!="score")  ){
  48.     $fromGoogle = TRUE;
  49.     $_SESSION['fromGoogle']="TRUE";
  50. }else{
  51.     $fromGoogle = FALSE;
  52.     $_SESSION['fromGoogle']="FALSE";
  53. }
  54.  
  55. if ("1"==$_GET['fb']){
  56.     $fromGoogle = FALSE;
  57. }
  58.  
  59. //cross_domain_persist allows variables like FREE to pass to other domains flexibly without the use of ... something that doesn't exist, "passing sessions"
  60. $cross_domain_persist = "&type=$getSpecial";
  61. if (!$fromGoogle){
  62.     $cross_domain_persist .= "&fb=1";
  63. }
  64.  
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement