title: Save form input in excel. Downloadable
body: <p>I have created a form and tried to export the input of the form to save it as excel in server. I get error in the PHP file that I have done. </p>
  
  <p>Can you please check this PHP and help me what i made a mistake or is there any shortcut for the same?</p>
  
  <p>The form that created is <code>praths.in</code></p>
  
  <p>This is the PHP :</p>
  
  <pre><code>{?php
  
  $clientname=$_POST{'field1'};
  $phonenumber=$_POST{'field2'};
  $followupdate=$_POST{'field3'};
  $branchname=$_POST{'field4'};
  $leadfrom=$_POST{'field5'};
  $planname=$_POST{'field6'};
  $expectedpremium=$_POST{'field7'};
  $remaks=$_POST{'field8'};
  $crmupdated=$_POST{'CRM-Update'};
  $smname=$_POST{'field9'};
  $branchname=$_POST{'field10'};
  $staffname=$_POST{'field11'};
  $discussionheld=$_POST{'field12'};
  
  $data=$field1.",".$field2,".$field3,".$field4,".$field5,".$field6,".$field7,".$field8,".$CRM-Update,".$field9,".$field10,".$field11,".$field12;
  
  
  $file="file.csv";
  
  
  file_put_contents($file, $data . PHP_EOL, FILE_APPEND);
  print "{h1 align=center}Thank you for submitting data!{/h1}";
  
  
  ?}
  {html}
  {head}
  {title}ThankYou Page{/title}
  {/head}
  {body}
  {h1}{a href="index.html"}GO BACK{/a} {/h1}
  
  {/body}
  
  
  
  
  {/html}
  </code></pre>