You'll surely hate me for askin', but.... a fella can't get his multiparts to post

Discussion in 'PHP' started by MBHT, Oct 26, 2005.

  1. #1
    I'm trying to get a mortgage quote form going on my site. It's a multipart php form with fields for name, last name, address, etc. that posts to my email. The html works great and the email posts but the problem is that none of the inputs come through and the message field is blank. I'm sure the problem is in my .php code, but I'm not sure what to write to capture each individual field in the message. The html can be found at http://www.mortgagedisclosure.com/MortgageQuote.htm and the php code I'll paste below:

    <?
    $email = $_REQUEST['email'] ;
    $message = $_REQUEST['message'] ;

    mail( "mail@mortgagedisclosure.com", "Feedback Form Results",
    $email, "From: $email" );
    header( "Location: http://www.mortgagedisclosure.com/thankyou.html" );
    ?>

    I know you're all probably incredibly tired of amateurs like me begging for help so I thank you and bestow upon you Developer par excellance awards in advance.

    Many Thanks,

    Steve
     
    MBHT, Oct 26, 2005 IP
  2. TheHoff

    TheHoff Peon

    Messages:
    1,530
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Where is the variable $message in your mail command?

    >> mail( "mail@mortgagedisclosure.com", "Feedback Form Results",
    $email, "From: $email" );
     
    TheHoff, Oct 26, 2005 IP
  3. MBHT

    MBHT Well-Known Member

    Messages:
    153
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    hey, vBMechanic, I've been meaning to reply to your question about my email campaign but was waiting for some actual results, which I am quickly coming to realize are just plain lacking. I think I got hosed (1M emails, no clicks after 48 hrs).

    as for the $message variabl;e, sorry, my bad. Mean to write:
    >> mail( "mail@mortgagedisclosure.com", "Feedback Form Results",
    $messagel, "From: $email" );

    but that isn't the prob: still emty of all the inputs.

    Thanks for answering,

    Steve
     
    MBHT, Oct 26, 2005 IP
  4. TheHoff

    TheHoff Peon

    Messages:
    1,530
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hmm when you said Multiparts, I assumed you meant a mime-encoding with an image attached.

    Am I looking at the wrong page? Where are you getting the $message variable? The form you linked to in the first post has a bunch of select fields and such, with nothing called message.
     
    TheHoff, Oct 26, 2005 IP
  5. MBHT

    MBHT Well-Known Member

    Messages:
    153
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #5
    uh-huh. The more you write, the stupider I look. REALLY, I have NO idea what I'm trying to say.

    You're right. There is no "message" input. I left that in as a mistake because I got it from a script tutorial for dimwits.

    The problem is that when I tried to replace $message with, say $name I could actually get the name input to show up, but if I tried to put a $lastname variable under that...nothing.

    The problem is that I can get one input to show up, but no more.

    THANKS
     
    MBHT, Oct 26, 2005 IP
  6. TheHoff

    TheHoff Peon

    Messages:
    1,530
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hmmm OK I think you need to concate the variables into one "message" .. meaning take all of the different inputs and combine them into the variable $message

    Say you have $firstname, $lastname, $birthdate, $socialsecurity

    combine those into one variable called $message and send that in your email

    $message = $_REQUEST['firstname']." ".$_REQUEST['lastname']."\n\n".$_REQUEST['birthdate']."\n\n".$_REQUEST['socialsecurity'];

    The \n indicates a newline.. sometimes you have to do \n\r instead depending on the format the mail is sent and read in.
     
    TheHoff, Oct 26, 2005 IP
  7. MBHT

    MBHT Well-Known Member

    Messages:
    153
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #7
    vB,
    I think I hear what you're saying. I'll try it. Thanks MUCH for your help, and I'll keep you updated on the email campaign.
     
    MBHT, Oct 26, 2005 IP