title: Snippet not working in MODx
body: <p>I've got a snippet in my ModX Evo. The problem is that on my local this shippet is working ok,but when I upload it to the host it returns only blank space. The code is a mess, but I need to get figured that out. Any ideas?Thx.</p>
  
  <pre><code>    &lt;?php
  $action=$_GET['action'];
  
  switch ($action){
  case('add'):_add();break;
  case('view'):_view();break;
  case('order'):_order();break;
  case('del'):_del();break;
  
  }
  /////////////////////////////////////////////////////////////////
  function _add()
  {
  global $modx;
  session_start();
  if(!session_is_registered('things')){session_register('things');}
  $ar=$_SESSION['things'];
  $ar_size=sizeof($ar)-1;
  $break=false;
  $i=0;
  if($ar_size&gt;=0)
   {
    while ($i&lt;=$ar_size):
    $buf=$ar[$i];
     if($buf['id']==$_GET['thing']){$_SESSION['things'][$i]['count']=$buf['count']+1;$break=true;}
    $i++;
    endwhile;
   }
  if($break==false){
  $_SESSION['things'][($i)]=array('title' =&gt; $_GET['title'],
  'id'=&gt;$_GET['thing'],
  'price'=&gt;$_GET['price'],
  'count'=&gt;1);}
  $modx-&gt;sendRedirect("/index.php?id=".$_GET['return']);
  
  
  }
  function _view()
  {
  if (!isset($_GET['zakaz'])){
  
  session_start();
  if(!session_is_registered('things')){session_register('things');}
  
  
  if (isset($_GET['del']))
  {
  $buf=array();
  $ar=$_SESSION['things'];
  $ar_size=sizeof($ar)-1;
  if($ar_size&gt;=0)
   {  
    $i=0;
    while ($i&lt;=$ar_size):   
      if(($i+1)!=$_GET['del']){$buf[sizeof($buf)]=$ar[$i];}
      $i++;
     endwhile;
  
  }
  $_SESSION['things']=$buf;
  
  }
  if (isset($_GET['delall']))
  {
  $_SESSION['things']=array();
  }
  if (isset($_GET['cn']))
  {
  $c=$_GET['cn'];
  $ar=$_SESSION['things'];
  $ar_size=sizeof($ar)-1;
  if($ar_size&gt;=0)
   {  
    $i=0;
    while ($i&lt;=$ar_size): 
      $b=(int)$c[$i];
      if($b&gt;0)
         {
          $ar[$i]['count']=$b;
         }else{$ar[$i]['count']=1;}
      $i++;
     endwhile;
  }
  $_SESSION['things']=$ar;
  
  }
  
  if((isset($_GET['peresh']))or(isset($_GET['del']))or(isset($_GET['delall'])))
  {
  global $modx;
  $modx-&gt;sendRedirect("/index.php?id=10&amp;action=view");
  
  }
  ?&gt;
  &lt;form action='index.php' method='GET'&gt;
  &lt;input type="hidden" value="10" name="id"&gt;
  &lt;input type="hidden" name="action" value="view"&gt;
          &lt;table border=0 cellpadding=4 cellspacing=2 width='100%'&gt;
          &lt;tr align='center'&gt;
          &lt;td align=center colspan=5 bgcolor='#c5dcf8' class='table_title'&gt;Ваша корзина&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr align='center'&gt;
          &lt;td bgcolor='#c5dcf8'&gt;№&lt;/td&gt;
          &lt;td bgcolor='#c5dcf8' &gt;наименование товара&lt;/td&gt;
          &lt;td bgcolor='#c5dcf8'&gt;&lt;nobr&gt;цена, руб.&lt;/nobr&gt;&lt;/td&gt;
          &lt;td bgcolor='#c5dcf8'&gt;кол-во&lt;/td&gt;
          &lt;td bgcolor='#c5dcf8'&gt;удалить&lt;/td&gt;
          &lt;/tr&gt;
  
  &lt;?php
  $ar=$_SESSION['things'];
  $ar_size=sizeof($ar)-1;
  $break=false;
  $i=0;
  if($ar_size&gt;=0)
   {
    $summ=0;
    while ($i&lt;=$ar_size):
    $buf=$ar[$i];
     $i1=$i;
     $i++;
     $name=$buf['title'];
     $id=$buf['id'];
     $price=$buf['price']*$buf['count'];
     $summ=$summ+$price;
     $count=$buf['count'];
     echo"&lt;tr&gt;&lt;td bgcolor=\"white\" style=\"color:black;\" align=\"center\"&gt;$i&lt;/td&gt;&lt;td bgcolor=\"white\"style=\"color:black;\" align=\"center\"&gt;
  &lt;a style=\"color:blue\" href=\"/index.php?id=$id\"&gt;$name&lt;/td&gt;&lt;td bgcolor=\"white\"style=\"color:black;\" align=\"center\"&gt;$price&lt;/td&gt;
  &lt;td bgcolor=\"white\" style=\"color:black;\" align=\"center\"&gt;&lt;input type=\"edit\" name=\"cn[$i1]\" value=\"$count\"SIZE=\"4\"&gt;&lt;/td&gt;
  &lt;td bgcolor=\"white\" style=\"color:black;\" align=\"center\"&gt;&lt;a href=\"/index.php?id=10&amp;action=view&amp;del=$i\" onclick=\"return confirm('Вы согласны?')\"&gt;&lt;font color=\"Maroon\" style=\"color:Maroon;font-weight:bold;font-size:16px;text-decoration:none;\"&gt;X&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";
   endwhile;
  ?&gt;
  &lt;tr&gt;&lt;td colspan="2" align="right" bgcolor="white"&gt;&lt;b style="color:navy"&gt;Итого к оплате:&lt;/td&gt;&lt;td style="color:blue;"bgcolor="white" align="center"&gt;&lt;?php echo $summ; ?&gt;&lt;/td&gt;&lt;td align="center"&gt;&lt;input name="peresh" style="font-size:10px" type="submit" value="Пересчитать"&gt;&lt;/td&gt;&lt;td align="center"&gt;&lt;input style="font-size:10px" name="delall" type="submit" onclick="return confirm('Вы согласны?')" value="Удалить все"&gt;
  &lt;/table&gt;&lt;br&gt;&lt;center&gt;&lt;input type="submit" name="zakaz" value="Оформить заказ"&gt;&lt;/center&gt;&lt;/form&gt;
  
  &lt;?php
   }
  else
  {
  ?&gt;
  &lt;tr&gt;&lt;td colspan="5" align="center" valign="middle" height="60" style="color:blue" bgcolor="white"&gt;Корзина пуста&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;&lt;/form&gt;
  
  &lt;?php
  }
  }
  else
  {
  //////////////////////для заказа////////////////////////
  
  }
  ?&gt;
  
  &lt;?php
  }
  </code></pre>