Interactive Programming Forums
Login
Register
Home
Questions/Snippets/Exercises
Unanswered
Tags
Ask a Question
Post a Code Snippet
Post an Exercise
Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.
All categories
Ruby
(3)
Python
(10)
PHP
(7)
Perl
(2)
SQL
(8)
Javascript
(6)
HTML
(20)
CSS
(4)
jQuery
(0)
XML
(3)
Code Snippets
(1)
Exercises
(4)
Other
(9)
Adding correct action command to send email
+15
votes
I am a newbie so please bear with me ... I am editing a template but cannot get the submit button to send an email directly. The only command I get to work is for the the default email client to open and then the person can complete and send. Here is a copy of the script - I need the command (php?) to replace the # at the action command:
<form id="contact" method="post" action="#">
<div class="row1">
<span class="formlabel">your name</span>
<span class="forminput"><input type="text" /></span>
</div>
<div class="row1">
<span class="formlabel">your email address</span>
<span class="forminput"><input type="text" /></span>
</div>
<div class="row1">
<span class="formlabel">your enquiry</span>
<span class="forminput"><textarea cols="28" rows="11" class="textarea"></textarea></span>
</div>
<div class="spacer"> </div>
<div class="row1">
<span class="formlabel"></span>
<span class="forminput"><input type="submit" value="submit" class="submit" /></span>
</div>
</form>
Thank you in anticipation ...
posted
12 years
ago
in
CSS
by
freekstegmann
(
1,920
points)
1 Answer
+1
vote
Hello freekstegmann,
Example:
action="email.php"
email.php will $_POST all forms input and validate them, after validation do:
<?php
$header = "From: ". $mail_from . " <" . $mail_subject . ">\r\n";
mail($mail_to,$mail_subject,$email_body,$header);
$error_msg="E-mail has been sent successfully to Yourwebside.com.";
header("Location: contact.php?error_msg=$error_msg");
?>
answered
12 years
ago
by
vlad36
(
7,400
points)
Related questions
+10
votes
1
answer
i want to download ruby program both line command and GUI
posted
12 years
ago
in
Ruby
by
jampart
(
2,250
points)
+7
votes
1
answer
CSS tutorials
posted
12 years
ago
in
CSS
by
friskyding0
(
1,940
points)
background-color
css
tutorial1
color
+19
votes
1
answer
what the different between c++ and java language
posted
13 years
ago
in
CSS
by
Mtata D Mtatuz
(
1,490
points)
+14
votes
0
answers
how delete,update,and insert new items in gridview
posted
13 years
ago
in
CSS
by
Abdulqadir Farhang
(
260
points)
+3
votes
1
answer
I want more stuff after this to learn too!
posted
11 years
ago
in
Javascript
by
James Dana Hanson
(
1,450
points)