/    Sign up×
Community /Pin to ProfileBookmark

PHP Email Form

I’ve made a simple html inquiry form that I’m trying to make functional with php, which is something I have little understanding of.

The php I’m using comes from a tutorial but it only deals with two value inputs: e-mail and message, I’d like to add a third input and want its value to be placed above the message value in the sent email but I’m unsure how to do this, I’ve been playing around with it but to no avail, can someone please help me?

[code=php]
<?php
$email = $_REQUEST[’email’] ;
$message = $_REQUEST[‘message’] ;

mail( “[email protected]”, “Inquiry”,
$message, “From: $email” );
header( “Location: sent.html” );
?>
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@niczakJul 27.2008 — <?php

// multiple recipients

$to = '[email protected]' . ', '; // note the comma

$to .= '[email protected]';

// subject

$subject = 'Birthday Reminders for August';

// message

$message = '

<html>

<head>

<title>Birthday Reminders for August</title>

</head>

<body>

<p>Here are the birthdays upcoming in August!</p>

<table>

<tr>

<th>Person</th><th>Day</th><th>Month</th><th>Year</th>

</tr>

<tr>

<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>

</tr>

<tr>

<td>Sally</td><td>17th</td><td>August</td><td>1973</td>

</tr>

</table>

</body>

</html>

';

// To send HTML mail, the Content-type header must be set

$headers = 'MIME-Version: 1.0' . "rn";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";

// Additional headers

$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "rn";

$headers .= 'From: Birthday Reminder <[email protected]>' . "rn";

$headers .= 'Cc: [email][email protected][/email]' . "rn";

$headers .= 'Bcc: [email][email protected][/email]' . "rn";

// Mail it

mail($to, $subject, $message, $headers);

?>
×

Success!

Help @converge 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...