Our requirement is to write the variables to a text file in append mode. This can be only partially achieved by the below coding.
First two variable - vuserid and vworkorder are obtained from $_GET, this can be written on the page using ECHO command, however using fwrite + $_POST it is not getting written to File. All Other Variables that are as per user response on the page can be written to the file.
<?php
$f = fopen("textfile.txt", "a");
fwrite($f, $_POST["vuserid"] );
fwrite($f, "|");
fwrite($f, $_POST["vworkorder"]);
fwrite($f, "|");
fwrite($f, $_POST["Ques1"]);
fwrite($f, "|");
fwrite($f, $_POST["Ques2"]);
fwrite($f, "|");
fwrite($f, $_POST["Ques3"]);
fwrite($f, "|");
fwrite($f, $_POST["Ques4"]);
fwrite($f, "|");
fwrite($f, $_POST["q14"]);
fwrite($f, ";");
// Close the text file
fclose($f);
echo "Thanks for your Response";
?>