hi i am a beginner of php i just want to know the code or procedure to write a data in file automatically when submit button is clicked.. for example. if i am getting a data from the user like name,age etc....after finishing the form ,if user clicks the submit button ,it should be automatically store in word pad or note pad... pls help me in this problem..
Have an html form set up like... <html><head></head><body><form method="POST" action="action.php"> <p><input type="text" name="name" /></p> <p><input type="text" name="age" /></p> <p><input type="submit" value="Submit" /></p> </form> </body></html> Then have a PHP file to process it like so... <?php $content = $_POST['name']."\n".$_POST['age']."\n \n"; $fh1 = fopen("storeInfo.txt", 'w') or die("Error, can't open file"); fwrite($fh1, $content); fclose($fh1); ?>