Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="web_form" id="web_form" method="post" action="process-form-data.php">
- <p><label>Name: </label><input type="text" name="name" id="name" /></p> <!-- typo duplicated id -->
- <p><label>Email: </label><input type="text" name="email" id="email" /></p> <!-- typo duplicated id -->
- <p><label>Phone: </label><input type="text" name="phon" id="email" /></p> <!-- typo duplicated id -->
- <p><label>Address: </label><input type="text" name="add" id="email" /></p> <!-- typo duplicated id -->
- <p><input type="submit" name="1" id="s1" value="Submit" /></p>
- </form>
- php code :
- <?php
- $name = $_POST['name'];
- $email = $_POST['email'];
- $phon = $_POST['phon'];
- $add= $_POST['add'];
- $fp = fopen("mailing.txt", "a");
- $savestring = $name . "," . $email .",".$phon."."$add. "n"; \\ should be "\r\n" not "n". Why $phon and $add are not comma seperated?
- fwrite($fp, $savestring);
- fclose($fp);
- echo "<h1>You data has been saved in a text file!</h1>";
- ?>
- I have a text file mailing.txt
- with predefined format
- like :
- Name Email Phone Address
- when I will submit the form.
- the data must come (append) in each mentioned below column please help .
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement