/    Sign up×
Community /Pin to ProfileBookmark

PHP – How to get the whole form in the body of the email

I have a form on my site that is broken into 4 different sections:
[ATTACH]10008[/ATTACH]

I need this form to email to me when a person clicks submit. All 4 are linked in this code which is located in the head of my html page:

[SIZE=”3″]

[CODE]<script language=”JavaScript”>
<!–
function SubmitAll(){
document.application1.submit();
document.application2.submit();
document.application3.submit();
document.application4.submit();
}
function ResetAll(){
document.application1.reset();
document.application2.reset();
document.application3.reset();
document.application4.reset();
}
–>
</script>[/CODE]

[/SIZE]

Now, here is my PHP code:

[CODE]<?
$firstname = $_REQUEST[‘firstname’] ;
$lastname = $_REQUEST[‘lastname’] ;

$address = $_REQUEST[‘address’] ;
$city = $_REQUEST[‘city’] ;
$state = $_REQUEST[‘state’] ;
$zip = $_REQUEST[‘zip’] ;

$phone = $_REQUEST[‘phone’] ;

$email = $_REQUEST[’email’] ;

$psy = $_REQUEST[‘psy’] ;
$speech = $_REQUEST[‘speech’] ;
$ot = $_REQUEST[‘ot’] ;
$pt = $_REQUEST[‘pt’] ;
$teacher = $_REQUEST[‘teacher’] ;

$cert1 = $_REQUEST[‘cert1’] ;
$cert2 = $_REQUEST[‘cert2’] ;
$cert3 = $_REQUEST[‘cert3’] ;

$hrlyrate = $_REQUEST[‘hrlyrate’] ;

$contractdays_1 = $_REQUEST[‘contractdays_1’] ;
$contractdays_2 = $_REQUEST[‘contractdays_2’] ;
$contractdays_3 = $_REQUEST[‘contractdays_3’] ;
$contractdays_4 = $_REQUEST[‘contractdays_4’] ;
$contractdays_5 = $_REQUEST[‘contractdays_5’] ;

mail( “This is where my email address is”, “Application”,
$message, “From: $email” );
header( “Location: This is my Thank You page” );
?>[/CODE]

As you can see from the image I provided I have text boxes, a drop down list, radio buttons and check boxes that I need to have submitted. Another forum has told me to add this code into the PHP form

[CODE]$message = $lastname . $firstname ;

mail( “This is where my email address is”, “Application”,
$message, “From: $email” );
header( “Location: This is my Thank You page” );
?>[/CODE]

and to keep listing the rest of those $ functions. When I do this an email gets sent to me with only the things that are text fields (nothing happens for the radio buttons, check boxes and drop down list) and they are strung together like:

firstnamelastnameaddress

with no spaces. How do I submit this form so that when the email comes to my address it will look like the form on the site?

[upl-file uuid=ce3fc7a5-bc90-4b74-845b-f181008d42d5 size=75kB]screen.jpg[/upl-file]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @viathan 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,
)...