title: Website user input post to a file in my pc
body: <p>I need help with a php program. I cant find the problem
  This is the code I came up with. I just have multiple user inputs and I need the php code to put those inputs in a file.</p>
  
  <pre><code>&lt;?php
  if(isset($_POST['submit']))
  {
  $name = $_POST['name'];
  $discord = $_POST['discord'];
  $adress = $_POST['adress'];
  $age = $_POST['age'];
  $W1 = $_POST['W1'];
  $W2 = $_POST['W2'];
  $W3 = $_POST['W3'];
  
  $file = fopen("userinput.txt","a+") or die ("file not open");
  
  $s = $name. "," .$discord."," .$adress."," .$age."," .$W1."," .$W2."," .$W3.",\n";
  fputs($file,$s) or die ("Data not write");
  
  fclose($file);
  }
  ?&gt;&lt;?php
  if(isset($_POST['submit']))
  {
  $name = $_POST['name'];
  $discord = $_POST['discord'];
  $adress = $_POST['adress'];
  $age = $_POST['age'];
  $W1 = $_POST['W1'];
  $W2 = $_POST['W2'];
  $W3 = $_POST['W3'];
  
  $file = fopen("userinput.txt","a+") or die ("file not open");
  
  $s = $name. "," .$discord."," .$adress."," .$age."," .$W1."," .$W2."," .$W3.",\n";
  fputs($file,$s) or die ("Data not write");
  
  fclose($file);
  }
  ?&gt;
  </code></pre>