/    Sign up×
Community /Pin to ProfileBookmark

PHP form submit and send email

Hi,
I am now designing a form, where an user has to enter some information in the input fields provided.

=> In the second step, I need to provide a view of what he has filled and there should be two buttons “BACK” and “Submit”, where he can verify the details he entered and if he needs any changes, he can click back and edit the details or he can submit if everything is fine.

=> once he submits the form, A mail should be triggered with an PDF attachment to one of the executive mail id, that a customer filled the a form.

I was really confused where to start with and how ??

Please suggest me.

regards,
Trivirkam.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@insidioustranceFeb 02.2012 — you can get the information entered on first page through $_GET("fieldname") on second page and display it in a form with those fields disabled with back and submit button.When user click submit button , you can use php mail function to send mail to the required mail id.The format of PHP mail function is:

<?php

if (isset($_REQUEST['email']))

//if "email" field is filled up, send email

{

//send email

$email = $_
REQUEST['email'] ;

$subject = $_REQUEST['subject'] ;

$message = $_
REQUEST['message'] ;

mail("[email protected]", "$subject",

$message, "From:" . $email);

echo "Thank you for using our mail form";

}

else

//if "email" is not filled out, display the form

{

echo "<form method='post' action='mailform.php'>

Email: <input name='email' type='text' /><br />

Subject: <input name='subject' type='text' /><br />

Message:<br />

<textarea name='message' rows='15' cols='40'>

</textarea><br />

<input type='submit' />

</form>";

}

?>
×

Success!

Help @trivikrama spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...