ajfmrf
09-03-2011, 05:30 AM
I put these two scripts on one page.
submit.php
<?php
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {
echo '<strong>Incorrect verification code.</strong><br>';
} else {
// add form data processing code here
echo '<strong>Verification successful.</strong><br>';
};
?>
mail.php
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$design = $_POST['design'];
$change = $_POST['change'];
$how = $_POST['how'];
$message = $_POST['message'];
$formcontent=" From: $name \n Email: $email \n How do we look: $design \n What would you Change: $change \n How did you get here: $how \n Message: $message";
$recipient = "youremailaddresshere";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We appreciate you took time to fill out our feedback form." . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
It works but gives a warning message along with the thank you note.
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/webuseri/public_html/css/5/mail2.php:13) in /home/webuseri/public_html/css/5/mail2.php on line 15
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$design = $_POST['design'];
$change = $_POST['change'];
$how = $_POST['how'];
$message = $_POST['message'];
$formcontent=" From: $name \n Email: $email \n How do we look: $design \n What would you Change: $change \n How did you get here: $how \n Message: $message";
$recipient = "aflorkoski6821@tvcconnect.net";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We appreciate you took time to fill out our feedback form." . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {
echo '<strong>Incorrect verification code.</strong><br>';
} else {
// add form data processing code here
echo '<strong>Verification successful.</strong><br>';
};
?>
Can this warning be eliminated or do I have to find a way to use two "action="" in the form or something??
Bud
submit.php
<?php
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {
echo '<strong>Incorrect verification code.</strong><br>';
} else {
// add form data processing code here
echo '<strong>Verification successful.</strong><br>';
};
?>
mail.php
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$design = $_POST['design'];
$change = $_POST['change'];
$how = $_POST['how'];
$message = $_POST['message'];
$formcontent=" From: $name \n Email: $email \n How do we look: $design \n What would you Change: $change \n How did you get here: $how \n Message: $message";
$recipient = "youremailaddresshere";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We appreciate you took time to fill out our feedback form." . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
It works but gives a warning message along with the thank you note.
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/webuseri/public_html/css/5/mail2.php:13) in /home/webuseri/public_html/css/5/mail2.php on line 15
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$design = $_POST['design'];
$change = $_POST['change'];
$how = $_POST['how'];
$message = $_POST['message'];
$formcontent=" From: $name \n Email: $email \n How do we look: $design \n What would you Change: $change \n How did you get here: $how \n Message: $message";
$recipient = "aflorkoski6821@tvcconnect.net";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We appreciate you took time to fill out our feedback form." . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
session_start();
if ($_POST["vercode"] != $_SESSION["vercode"] OR $_SESSION["vercode"]=='') {
echo '<strong>Incorrect verification code.</strong><br>';
} else {
// add form data processing code here
echo '<strong>Verification successful.</strong><br>';
};
?>
Can this warning be eliminated or do I have to find a way to use two "action="" in the form or something??
Bud