/    Sign up×
Community /Pin to ProfileBookmark

Form Not Fourm

I got the whole radio buttions down and check boxes but how do i make the summit buttion send the anwser in an e-mail to my address?

This is what i have so far

[code=php]<FORM>
<P>
First name: <INPUT type=”text” name=”firstname”><BR>
Last name: <INPUT type=”text” name=”lastname”><BR>
Phone number:<INPUT type=”text” name=”phone#”><BR>
email: <INPUT type=”text” name=”mail”><BR>
<INPUT type=”radio” name=”sex” value=”Male”> Male<BR>
<INPUT type=”radio” name=”sex” value=”Female”> Female<BR>
<INPUT type=”submit” value=”Send”> <INPUT type=”reset” value=”reset”>
</P>
</FORM>
[/code]

How do i make it send the anwsers to my e-mail

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@GeorgeJohnsonNov 27.2004 — Does your host support PHP or Perl?
Copy linkTweet thisAlerts:
@GeorgeJohnsonNov 27.2004 — <?php

$fname = $_POST['firstname'];

$lname = $_
POST['lastname'];

$phone = $_POST['phone#'];

$email = $_
POST['mail'];

$sex = $_POST['sex'];

$to = "[email protected]"

$subject = "Email From Your Website, Sent from ".$fname." ".$lname;

if ($sex == "Male") { $title = "Mr" } elseif ($sex == "Female") { $title = "Mrs/Miss"; }

$message = "Email From Your Website,

Sent from: ".$title." ".$fname." ".$lname."

Phone: ".$phone."

Email: ".$email."

IP Address: ".$_SERVER['REMOTE_ADDR']."

";

$headers = "To: yourName <[email protected]rn";

$headers .= "From: ".$fname." ".$lname." <".$email.">rn";

$mailheader .= "Reply-To: ".$email;

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

?>

This is a basic e-mail script, albeit, it has no error checking whatsoever. Also, this requires your server to be configured to use PHP.

For the form, you need to change the tag to something like:

<form method=POST action="email.php"> and then name the above script to email.php
Copy linkTweet thisAlerts:
@summyNov 28.2004 — It depends on your server.

It may also support ASP.

In most cases you need the smpt server configuration to be able to send email from your webpage.

If you use frontpage, it will be easier, but your host must also support frontpage extensions.
Copy linkTweet thisAlerts:
@MstrBobNov 28.2004 — [URL=http://www.webdeveloper.com/forum/showthread.php?s=&threadid=39991]Form Submission[/URL] (AKA: Forum Sticky!)
×

Success!

Help @chames 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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