PHP and contact form

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default PHP and contact form

    I'm a virgin at PHP, so go easy. :)

    I have a contact form and a separate PHP script that I'm attempting to author.

    I have no problem with it working with my server, however I can't get the
    appropriate fields to populate in the generated e-mail.

    Here is my form:

    <form action="includes/php_scripts/send-mail-sda.php" method="post"
    enctype="multipart/form-data" name="contactMe" id="contact_form">
    <p align="center">The time is<span class="style5"> <?php echo date("h:i:s a",
    time())?></span> local</p>
    <p>First Name :
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

    <input name="FirstName" type="text" id="FirstName" size="35" />
    </p>
    <p>LastName:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;

    <input name="LastName" type="text" id="LastName" size="35" />
    </p>
    <p>Message:</p>
    <div class="message-area">
    <div align="center">
    <input type="submit" name="Submit" value="Submit" />
    <textarea name="Message_area" cols="50" rows="30" id="Message_area"></textarea>
    <input name="Submit-reset" type="reset" id="Submit-reset" value="Clear" />
    </div>
    </div>
    </form>


    And... here is my "send-mail-sda" script:

    <?PHP mail ("steve123@localhost", "contact-form-submission", "message",
    $message = ("Message_area") .
    "Reply-To: {sd_a@msn.com}\r\n" .
    "X-Mailer: PHP/" . phpversion());?>

    How can I get the input types to populate the sent e-mail? I've got a PHP
    reference book, but I can't find an example of a contact form.

    Muchly appreciated.
    sda Guest

  2. Similar Questions and Discussions

    1. contact form
      Can anyone help me. I have a contact form on my site it works ok when anyone submits the form and the confirmation page opens ok. The prob I have...
    2. Contact form with DateField
      I hope someone can help me with this because I can't get it to work myself. I have created an contact form with Flash and in this form there is a...
    3. Flash Contact Us Form
      Hey Everyone, I need to get a contact us form in a flash site to send an email to me when someone submits it. I bought a template...
    4. Contact Us Form
      Can somebody please give me a simple script for a form that is going to be sent to design@netzed.co.uk. Has a text field for contact name, email...
    5. Guide to stting up a contact form ?
      Hi, Are there any guides to how to set up a contact form ? At the very least a basic tutorial (my host uses CDONTS) and at best one which...
  3. #2

    Default PHP and contact form

    I'm a virgin at PHP, so go easy. :)

    I have a contact form and a separate PHP script that I'm attempting to author.

    I have no problem with it working with my server, however I can't get the
    appropriate fields to populate in the generated e-mail.

    Here is my form:

    <form action="includes/php_scripts/send-mail-sda.php" method="post"
    enctype="multipart/form-data" name="contactMe" id="contact_form">
    <p align="center">The time is<span class="style5"> <?php echo date("h:i:s a",
    time())?></span> local</p>
    <p>First Name :
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


    <input name="FirstName" type="text" id="FirstName" size="35" />
    </p>
    <p>LastName:
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;


    <input name="LastName" type="text" id="LastName" size="35" />
    </p>
    <p>Message:</p>
    <div class="message-area">
    <div align="center">
    <input type="submit" name="Submit" value="Submit" />
    <textarea name="Message_area" cols="50" rows="30" id="Message_area"></textarea>
    <input name="Submit-reset" type="reset" id="Submit-reset" value="Clear" />
    </div>
    </div>
    </form>


    And... here is my "send-mail-sda" script:

    <?PHP mail ("steve123@localhost", "contact-form-submission", "message",
    $message = ("Message_area") .
    "Reply-To: {sda@msn.com}\r\n" .
    "X-Mailer: PHP/" . phpversion());?>

    How can I get the input types to populate the sent e-mail? I've got a PHP
    reference book, but I can't find an example of a contact form.

    Muchly appreciated.
    sda Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139