I have to read the values of multiple elements, put them into variables and then write them with default text to a file. I'm now using javascript and php. I hope you can help me. I am possibly open to other solutions.
This is what I have right now:
    <script>
  function createfile(){
    var maximum = x;
    var element = 0;
    var Element_exists = document.getElementById(element);
    if(Element_exists){
      function toggle(Element_exists){
          if(Element_exists.tagName === 'Input'){
              var p_name = document.getElementById(element).value;
              var p_font = document.getElementById(element + "_font").value;
              var p_fontsize = document.getElementById(element + "_fontsize").value;
              var total_p = "</p>"+ p_name + " new text "+ p_font +" even more new text " + p_fontsize + " last bit of text</p>"
          }else{
          }
      }
      <?php
      $myfile = fopen("newfile.txt", "w") or die("Unable to open file!");
      $txt = total_p;
      fwrite($myfile, $txt);
      fclose($myfile);
      ?>
    }
  }
  </script>
 
     
    