Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Formmail Help!

  1. #1
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formmail Help!

    Hi can anyone tell me why the data sent fromthe html does not appear in the email received please? I need the value Q1 (radio button response) to be sent in th email!!!!!

    HTML----

    <input type="hidden" name="board2" value="BB Comp January">
    <input type=hidden name="subject" value="BB January Comp">
    <input type=hidden name="recipient" value="paul@uknetweb.com">
    <tr valign="top">
    <td width="280" height="74">
    <p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Q1</b>
    In the &quot;Board room&quot; section, which is Beachbeats
    sister site called for classic longboards?</font></p>
    </td>
    <td width="270" height="74"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
    <input type="radio" name="Q1" value="Cord">
    Cord<br>
    <input type="radio" name="Q1" value="Cape">
    Cape<br>
    <input type="radio" name="Q1" value="Core">
    Core</font></td>

    ------------------------------------------------------------------------

    The PHP page that this sends to...

    <?
    $subject = ("$subject");
    $Q1 = stripslashes ("$Q1");
    $from = "From:\"$realname\" <$from>\nX-Mailer: uknetweb_PHP";
    $comment = stripslashes($comment);
    mail("paul@uknetweb.com",$subject,$comment,$from,$Q1);
    if (mail($email,$subject,$comment,$from,$Q1))
    {
    echo "Email sent correctly. We will be in touch with you shortly";
    } else {
    echo "Email failed to send. Please check their email address.";
    }
    ?>

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perhaps you have register_globals disabled? Use

    PHP Code:
    phpinfo(); 
    in an otherwise blank PHP file and check the PHP settings. If register_globals is disabled, that's basically a Good Thing(TM), and the only thing you need to do is to adjust the variables used in your script.

    Everything coming from a POST form appears in the superglobal $_POST array. You write

    PHP Code:
    $comment stripslashes($_POST['comment']); 
    instead. See also
    http://www.php.net/manual/en/securit...terglobals.php
    http://www.php.net/manual/en/languag...predefined.php
    De gustibus non est disputandum.

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    If you are using the popular formmail.php then you should consider using something else. There are security holes in it and people are exploiting it all over the place sending spam mail from other peoples accounts. At the very least change the name of the file because people are scanning servers looking for it.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Regular Coder
    Join Date
    Jan 2004
    Location
    Georgia
    Posts
    306
    Thanks
    0
    Thanked 0 Times in 0 Posts
    first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3. Then if that email is being sent to anyname@yourdomain.com then you need to send an email to that address first to make sure its enabled correctly on your server. And it seems like you forgot the beginning for the form unless you just forgot to paste it ?....looks like you forgot <form method="post" action="processor.php" />.....and dont forgot </form> at the end.
    ~Designer's Toolz~

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Originally posted by DsgnrsTLZAdmin
    first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3.

    Umm that's how radio buttons work. They have to be named the same so they work as a group otherwise you would be able to select all of them.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •