Re: Problem with code...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 6, 2011 at 7:29 PM, Jason Pruim <lists@xxxxxxxxxxxxxxxxxxxx>wrote:

>
> Jason Pruim
> lists@xxxxxxxxxxxxxxxxxxxx
>
>
>
> On Oct 6, 2011, at 9:04 PM, George Langley wrote:
>
> > On 2011-10-06, at 6:28 PM, Jason Pruim wrote:
> >>
> >> <?PHP
> >>
> >> //SETUP VARIABLES
> >>
> >> $mailTo = "lists@xxxxxxxxxxxxxxxxxxxx";
> >> $mailFrom = "lists@xxxxxxxxxxxxxxxxxxxx";
> >> //These 2 can be changed IF you know what you are doing and why!
> >> $returnPath = $mailFrom;
> >> $replyTo = $mailFrom;
> >> $mailSubject = "New Convention registration!";
> >>
> >> $message = "";
> >>
> >> //DO NOT CHANGE UNDER PENALITY OF BEING SLAPPED WITH A WET NOODLE!!!
> >>
> >> $headers = "From: ".$mailFrom."\n";
> >> $headers .= "Return-Path: ".$returnPath."\n";
> >> $headers .= "Reply-To: ".$replyTo."\n";
> >>
> >> function send_email($mailTo, $mailSubject, $mailMessage, $headers) {
> >>
> >>
> >>   if(mail( $mailTo, $mailSubject, $mailMessage, $headers )) {
> >>
> >>       $message = "Thank you for registering!";
> >>
> >>   }else {
> >>       echo "There was an issue with your registration.. Please try again
> later";
> >>   }
> >>
> >> }//Close Function
> >>
> >>
> >> if(!empty($errorCount)) {
> >>
> >>
> >>   }else {
> >>           //Build Email message
> >>           $mailmessage = "Full Name: " . $_POST['firstname'] . " " .
> $_POST['lastname'] . "\n\n";
> >>           $mailmessage .= "Address: " . $_POST['address'] . "\n\n";
> >>           $mailmessage .= "City, State, Zip: " . $_POST['city'] . " " .
> $_POST['state'] . " " . $_POST['zip'] . "\n\n";
> >>           $mailmessage .= "Phone: " . $_POST['phone'] . "\n\n";
> >>           $mailmessage .= "Email address: " . $_POST['email'] . "\n\n";
> >>           if($_POST['affiliation'] == "NFBOther") {
> >>               $mailmessage .= "Chapter Affiliation: " . $_POST['other']
> . "\n\n";
> >>           }else{
> >>               $mailmessage .= "Chapter Affiliation: " .
> $_POST['affiliation'] . "\n\n";
> >>           }
> >>           if($_POST['person'] =="Other"){
> >>               $mailmessage .= "Who will pick up the ticket? " .
> $_POST['Pfirstname'] . " " . $_POST['Llastname'] . "\n\n";
> >>
> >>           }else{
> >>               $mailmessage .= "Who will pick up the ticket? I will pick
> it up my self! \n\n";
> >>
> >>           }
> >>
> >> $mailmessage .= "Payment Method: " . $_POST['paymentMethod'];
> >>
> >>       send_email($mailTo, $mailSubject, $mailmessage, $headers);
> >>   }
> >>
> >> ?>
> >>
> >> Sometimes... It is dropping the last $mailmessage line... The payment
> method in the actual email it sends...
> >>
> >> Anyone have any ideas? I'm stumped....
> > ------------
> >       Hi there. First thought is perhaps it is not getting a value for
> paymentMethod and if it doesn't exist, will the line still get added?
> >       I would always check to see if every post variable isset, before
> adding the line. Can write a default line in its place if missing.
>
> The variable is being set with a default value of nothing else... But for
> some reason it's not bringing it through when the form is submitted...
>
> Any other ideas? hehe :)
>
>
Have you tested with the same payment method to see if somewhere in your
code or a hiccup in the server is causing the problem?  Does that happen to
any or certain payment method (including blank entry)?  I'm guessing it may
happen with only certain payment method.  From the line
if(!empty($errorCount)) {, I presume you have a mechanism in place to
sanitize and validate inputs?  I'd suggest you start troubleshooting from
there.  If this is still development phase, try to bypass that mechanism for
a quick confirmation that is causing the problem.

Regards,
Tommy

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux