php txt files

After completing the student registration form call the program below and record all student registration details to text file 



<html>

<?/************************
* register0.php
*
* Author Mr Eamonn
*
*Description : Dumps contents of PHP Global variable $_POST and record userinoput into text file
*
*
*************************/
?>



<title> Validate Input </title>

<body>

<div style = text-align:center;>

<h1> Checking Fields are Completed </h1>



<pre>

<?php print_r($_POST); ?>

</pre>

<?php
$fileHandle = fopen('userinput.txt', 'w+') OR die ("Can't open file\n");
$email=$_POST["email"];
fwrite ($fileHandle, $email);

?>

</body>


</html>

Scroll to Top