/    Sign up×
Community /Pin to ProfileBookmark

Post data not getting through to mailer

I posted something about this a little while ago, when I was having trouble with the captcha on a site. I just now realized though that none of the data from the form is getting through to the mailer. Somebody said their first thought is that it may be an encoding issue with his files, or the way they were uploaded, but I dunno… Does anybody have any ideas?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiDec 22.2008 — Without any source code it is going to be near impossible to help you.
Copy linkTweet thisAlerts:
@kudzugazetteauthorDec 22.2008 — Sorry

Form:
[code=html]<form name="feedback" action="./mailer.php" enctype="application/x-www-form-urlencoded" method="post">
<input type="hidden" name="rec_subject" value="Feedback" />
<input type="hidden" name="rec_return" value="feedback.php" />
<input type="hidden" name="rec_thanks" value="thankyou.php" />

<!--Form Data be here and is taken out for your convenience -->

<br><textarea cols="50" rows="15" name="Comments" id="r_comments"></textarea><br>
<img src="./captcha.php" alt="Verification code" width="150" height="45" border="0" /><br>
Please enter the verification code above into the text box below:<br>
<input type="text" name="code" maxlength="5" /><br>
<input type="submit" value="Submit">
<submit>
</form>[/code]


Mailer Script:
[code=php]<?php
ini_set('display_errors', 1); // you can change to 0 when done debugging
error_reporting(E_ALL);
//Captcha Verification
session_start();

if(md5($_POST['code']) != $_SESSION['key'])
{
die("The code you entered was not correct.");
}else{
//End Captcha Verification

@header("Cache-Control: no-cache, must-revalidate, max-age=0");
$required_errorpage = "error.php";


$from_address = @$HTTP_POST_VARS['E-mail'];
$required_on = "yes";
$return_to = @$HTTP_POST_VARS['rec_return'];
$incoming_mailto_cc = @$HTTP_POST_VARS['E-mail'];

// SET VARIABLES
$phone1 = @$HTTP_POST_VARS['phone1'];
$phone2 = @$HTTP_POST_VARS['phone2'];
$phone3 = @$HTTP_POST_VARS['phone3'];
$type = @$HTTP_POST_VARS['type'];
$firstname = @$HTTP_POST_VARS['First_Name'];
$lastname = @$HTTP_POST_VARS['Last_Name'];
$comments = @$HTTP_POST_VARS['Comments'];
$incoming_mailto = '-------------';
$incoming_system = @$HTTP_POST_VARS['System'];
$incoming_subject = @$HTTP_POST_VARS['rec_subject'];
$incoming_thanks = @$HTTP_POST_VARS['rec_thanks'];
$date = date('m/d/y G:i');
$break = "n";

// SET EMAIL INTRODUCTION
$message = (isset($HTTP_POST_VARS['rec_message'])) ? @$HTTP_POST_VARS['rec_message'] : "This email was spawned through an online form.";



// SET EMAIL FOOTER
$message .= "

Dear $firstname,
Thank you very much for your comments. Your input is always appreciated. If your comment requires a response you will hear from us shortly.

These are the details of your input:
Name: $firstname $lastname
E-mail: $from_address
Phone Number: ($phone1) $phone2 - $phone3
Type of Feedback: $type
Feedback: $comments
";

// CLEAR HEADERS
$headers = "";

// ADD FROM ADDRESS
if($from_address != "") {
$headers .= "From: $from_addressrn";
}

// CHECK FOR CC
if($incoming_mailto_cc != "") {
$headers .= "Cc: $incoming_mailto_ccrn";
}

// SEND EMAIL
if (!mail($incoming_mailto, $incoming_subject, $message, $headers)) {
header("Location: error.php");
exit();
}

// FORWARD TO THANK YOU PAGE
header("Location: $incoming_thanks?back=$return_to");
}
?>
[/code]
×

Success!

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