Jump to content

email form


ultratek

Recommended Posts

I was wondering what else it would take to make this process form work?

i saw in another topic a guy said something about headers...

Here is the code for my form and the php:

 

Form:

<form action="cgi-bin/form_mailer.pl" method="post" name="form1" id="form1">
        <input type="hidden" name="recipient" value="[email protected]" />
        <input type="hidden" name="subject" value="Your form has been submitted!" />
        <fieldset>
        <legend><span class="style3">Please enter your information in the form below:</span></legend>
          <table width="738" border="0" id="formTable">
          <tr>
            <td width="251" class="formLabel"><label for="label">Name:</label></td>
            <td width="477"><input name="name" type="text" class="inputField" id="name" accesskey="n" tabindex="10" /></td>
          </tr>
          <tr>
            <td class="formLabel"><label for="label">Email:</label></td>
            <td><span id="sprytextfield1">
              <input name="email" type="text" class="inputField" id="email" accesskey="e" tabindex="20" />
              <span class="textfieldRequiredMsg">Required.</span><span class="textfieldInvalidFormatMsg">Full email address.</span></span></td>
          </tr>
          <tr>
            <td class="formLabel"><label for="label">Phone:</label></td>
            <td><span id="sprytextfield2">
              <input name="phone" type="text" class="inputField" id="phone" accesskey="p" tabindex="30" />
              <span class="textfieldRequiredMsg">Required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span></td>
          </tr>
          <tr>
            <td class="formLabelTop"><label for="label">Summary:</label></td>
            <td><textarea name="request" cols="45" rows="5" class="inputField" id="request" accesskey="r" tabindex="40"></textarea></td>
          </tr>
          <tr>
            <td> </td>
            <td><input type="submit" value="Send Request" accesskey="s" tabindex="50" /></td>
          </tr>
                              </table>
        </fieldset>
      </form>

 

PHP:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Form Feedback</title>
</head>

<body>
<?php # Script 2.2 - handle_form.php

$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$request = $_POST['comments'];



?>
</body>
</html>

 

 

Link to comment
https://forums.phpfreaks.com/topic/125623-email-form/
Share on other sites

i am kinda new...

but this is what i came up with after reading some of the mail function link you gave

the subject is actually a phone number with dashes

<?php

$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['request'];
// multiple recipients
$to  = '[email protected]';


// subject
$subject = 'subject';

// message
$message = 'request';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'email' . "\r\n";


// Mail it
mail($to, $subject, $message, $headers);
?>

Link to comment
https://forums.phpfreaks.com/topic/125623-email-form/#findComment-649607
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.