Guest User

Untitled

a guest
May 25th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <form name="web_form" id="web_form" method="post" action="process-form-data.php">
  2. <p><label>Name: </label><input type="text" name="name" id="name" /></p>
  3. <p><label>Email: </label><input type="text" name="email" id="email" /></p>
  4. <p><label>Phone: </label><input type="text" name="phon" id="email" /></p>
  5. <p><label>Address: </label><input type="text" name="add" id="email" /></p>
  6. <p><input type="submit" name="1" id="s1" value="Submit" /></p>
  7. </form>
  8.  
  9. php code :
  10.  
  11. <?php
  12. $name = $_POST['name'];
  13. $email = $_POST['email'];
  14. $phon = $_POST['phon'];
  15. $add= $_POST['add'];
  16. $fp = fopen("mailing.txt", "a");
  17. $savestring = $name . "," . $email .",".$phon."."$add. "n";
  18. fwrite($fp, $savestring);
  19. fclose($fp);
  20. echo "<h1>You data has been saved in a text file!</h1>";
  21. ?>
  22. I have a text file mailing.txt
  23. with predefined format
  24. like :
  25. Name Email Phone Address
  26.  
  27. when I will submit the form.
  28. the data must come (append) in each mentioned below column please help .
Add Comment
Please, Sign In to add comment