Jump to content

PHP


Tarun
 Share

Recommended Posts

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

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 by niche
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...