title: how to add php code in .tpl file in prestashop
body: <p>Does anyone know how to add php code in <code>.tpl</code> file in prestashop..i tried a lot but couldn't find any solutions..I want to add a mail function in my <code>.tpl</code> file</p>
  
  <p>This is the function</p>
  
  <pre><code>&lt;?php
      $name=$_REQUEST["name"];
      $email=$_REQUEST["email"];
      $matter=$_REQUEST["matter"];
      $subject=$name."has shared a weblink";
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
      $contactMsg = '
      &lt;html&gt;
      &lt;head&gt;
      &lt;title&gt;Tell A Friend&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;table&gt;
      &lt;tr&gt;
      &lt;td&gt;E-mail: '.$email.' &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;Comment: '.$matter.' &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
      &lt;/body&gt;
      &lt;/html&gt;
      ';
      $headers .= "from:abcd" . "\r\n";
      $headers .= "To: Info &lt;info@abcd.in";
      $headers .= "reply-to:".$email."\r\n";
      $headers .= "Cc:".$email."\r\n";
      $headers .= 'Bcc: ' . "\r\n";
      if(mail($email, $subject, $contactMsg, $headers))
      {
      $_REQUEST = array();
      $error.="Mail Sent Successfully"; 
      }
      else
      {
      $error.="Error Mail Sent Fail!"; 
     // 
      }
   ?&gt;
  </code></pre>
  
  <p>i tried writing the code inside <code>{php}</code> <code>{/php}</code> block..but couldn't help
  And how to see the <code>error log</code> in <code>prestashop</code></p>