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 11 of 11

Thread: Feedback forms

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

    Feedback forms

    Hi. New poster here. Glad I found this place, I'm sure it will prove to be invaluable

    I'm trying to create a feedback form. I have made the form using dreamweaver and my hosting company has provided me with the following code for the php file:

    <?
    mail( "yourname@yourdomain.com", "Feedback Form Results",
    $message, "From: $email", "-fuser@userdomain.com" );
    header( "Location: http://www.yourdomain.com/thankyou.html" );
    ?>


    I've changed all the field names to correspond. It doesn't work properly. I recieve the email but with none of the details (email address, message etc). I've tried tinkering with it but to no avail. It's really infuriating actually !

    The html code is here btw:

    <FORM method=post action="sendmail.php">
    Email: <INPUT name="email" type="text"><br>
    Message:<br>
    <TEXTAREA name="message">
    </textarea><br>
    <input type=submit>
    </FORM>


    Any help would be greatly appreciated. Thanks everyone.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Your host needs to update their code they're handing out.
    PHP Code:
    <?php
    mail
    ("yourname@yourdomain.com""Feedback Form Results",
    $_POST['message'], "From: "$_POST['email'] ." <"$_POST['email'].">");
    header("Location: http://www.yourdomain.com/thankyou.html");
    ?>

  • #3
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for your reply.

    I copies and pasted your code, changed the email address etc but I still get the same result. An email arrives but no detail (email address, message etc).

    The from field says "INVALID_ADDRESS@.SYNTAX-ERROR", the subject field says "Feedback Form Results" (Which is correct btw).

    The email arrives but with no message in it.

    Any more help would be appreciated.

    Thanks.

  • #4
    New Coder
    Join Date
    Mar 2004
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have used that script on a website, it works 4 me. what email are u sending the message 2?
    If there is any LAWN BOWLERS that are under 16 here PM me!

  • #5
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's working now; FINALLY

    Thanks for your replies. I was maybe thinking of having another couple of fields. "Phone number", "Address" etc and maybe a couple of check boxes. Could anyone provide me any help on this?

    Thanks again

  • #6
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would really like to put a "name" and "phone" field in front of the message field but I'm having trouble.

    Here is my code: (PHP)

    <?php
    mail("email@mydomain.co.uk", "Feedback Form Results",
    $_POST['message'], "From: ". $_POST['email'] ." <". $_POST['email'].">");
    header("Location: http://www.mydomain.co.uk");
    ?>


    (HTML)
    <FORM method=post action="sendmail.php">
    Email: <INPUT name="email" type="text"><br>
    Message:<br>
    <TEXTAREA name="message">
    </textarea><br>
    <input type=submit>
    </FORM>


    I want to add form fields called "name" and "phone" to my form and have them emailed to my address.

    Do i have to add "name" and "phone" in $_POST['message'], for example?

    Thanks,

    Charlie.

  • #7
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Edited code
    PHP Code:
    <?php
    $mailbody 
    'Name : ' .  $_POST['txt_name'] . '. Phone : ' .  $_POST['txt_name'] .'. Message : ' .  $_POST['message'] ;
    mail("email@mydomain.co.uk""Feedback Form Results",
    $mailbody"From: "$_POST['email'] ." <"$_POST['email'].">"); 
    header("Location: http://www.mydomain.co.uk"); 
    ?>
    Edited form
    <FORM method=post action="sendmail.php">
    Name:<input name="txt_name" id="txt_name" /><br />
    Phone:<input name="txt_phone" id="txt_phone" /><br />
    Email: <INPUT name="email" type="text"><br>
    Message:<br>
    <TEXTAREA name="message">
    </textarea><br>
    <input type=submit>
    </FORM>
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #8
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Excellent. Thanks, mate.

    The email looks like this:

    Name: xxxxxxxx Phone: xxxxxxxxx Message: xxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Is there any way of changing the formatting of the emailbody so that it looks like this:

    Name: xxxxxxxxxxxx

    Phone: xxxxxxxxxxxx

    Message: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx

    Again, thanks for your help.

    Charlie.

  • #9
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Figured the formatting out now.

    Thanks

    Charlie.

  • #10
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    I just did a lecture on emails for a class I'm teaching. Perhaps this link will help...

    http://www.aphion.com/class/class9/sendmail.html

  • #11
    New to the CF scene
    Join Date
    Apr 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. I'll take a look.

    Charlie.


  •  

    Posting Permissions

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