Tarun Posted February 12, 2020 Share Posted February 12, 2020 i have created one php file and html file and connected to each other. But here i want a help reqards to php. Details mentioned below: This is my HTML file: <form method="post" action="contact.php"> <textarea name="message"></textarea> <input type="submit"> </form> This is my PHP file: <?php if($_POST["message"]) { mail("your@email.address", "Form to email message", $_POST["message"], "From: an@email.address"); } ?> Here i want to know is if i want to add another textarea say it as name in HTML, so can you help me with the PHP coding, as i have tried with adding the another text area in PHP to retrieve data to my email, but i am not able to receive that. Link to comment Share on other sites More sharing options...
Funce Posted February 16, 2020 Share Posted February 16, 2020 So the above is what works, show me what doesn't work. You want an email field. You seem to have idea on how to start it, I want to see what you do with it. Link to comment Share on other sites More sharing options...
niche Posted February 17, 2020 Share Posted February 17, 2020 (edited) add this line to your form: <input type="text" name="first_name"> and the first_name to your php message. Remember the message is a string. Edited February 17, 2020 by niche Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now