dongpai6567 2011-09-29 01:03
浏览 40

如何让我的“收音机”按钮显示在我的电子邮件中?

I have a form that I have been working on and I've been having problems only with the radio buttons not showing up on the emails I receive. I have tried everything to get the right code but I am not sure what to do...PLEASE HELP!

here is my code for the visual .php:

<p style="color: #e40001;">* Denotes required field.</p>

        <p><strong>General Information:</strong></p>

  <form method="post" name="commentForm" action="sendmail.php">
    <p>Your Name: <font size="2" color="#e40001">*</font>
    <input type="text" name="name" value="" size="20" class="required" />
    </p>

    <br />
    <p>Your Title:
    <input type="text" name="title" value="" size="20" />
    </p>

    <p>Company: <font size="2" color="#e40001">*</font>
    <input type="text" name="company" value="" size="20" class="required" />
    </p>

    <p>Email: <font size="2" color="#e40001">*</font>
    <input type="text" name="email" value="" size="20" class="required" />
    </p>

    <p>Website:
    <input type="text" name="website" value="" size="20" />
    </p>  

    <p>Address:
    <input type="text" name="address" value="" size="20" />
    </p>

    <p>City:
    <input type="text" name="city" value="" size="20" />
    </p>

    <p>State/Provice: <font size="2" color="#e40001">*</font>
    <input type="text" name="State" value="" size="20" class="required" />
    </p>

    <p>Zip Code: <font size="2" color="#e40001">*</font>
    <input type="text" name="zip" value="" size="20" class="required" />
    </p>  

    <p>Phone: <font size="2" color="#e40001">*</font>
    <input type="text" name="phone" value="" size="20" class="required" />
    </p> 

    <p>Fax:
    <input type="text" name="fax" value="" size="20" />
    </p><br /><br />                           

    <p><strong>Professional Information:</strong></p>

        <p>Type of business?
<SELECT name="operation"><option>--Select Operation--
    <option>---------------------
    <OPTION value=cafe/bar>Caf&eacute;/coffee bar
    <OPTION value=restaurant>Restaurant/Bar
    <OPTION value=kiosk>Kiosk
    <OPTION value=hotel>Hotel/Motel
    <OPTION value=university>University
    <OPTION value=hospital>Hospital
    <OPTION value=grocer/market>Grocer/Market
    <OPTION value=other>Other
    </select></p> 

    <p>If other, please desribe:
    <input type="text" name="other" value="" size="20" />
    </p><br /><br />        

    <p>Is this a new business?
    <input type="radio" name="newsletter-yes" id="radio" value="No" title="Check No if you would not like our newsletter" />New
    <input type="radio" name="newsletter-no" id="radio2" value="Yes" title="Check Yes if you would like our newsletter" />Existing</p>

    <p>I am interested in learning more about the following equipment:<br />
    <input type="radio" name="equipment" id="radio" value="BUNN Commercial Brewing &amp; Gridning Equipment">BUNN Commercial Brewing &amp; Gridning Equipment <br />
    <input type="radio" name="equipment" id="radio" value="La Marzocco Traditional Espresso Machines">La Marzocco Traditional Espresso Machines<br />
    <input type="radio" name="equipment" id="radio" value="Rancilio Traditional Espresso Machines">Rancilio Traditional Espresso Machines <br />
    <input type="radio" name="equipment" id="radio" value="Egro Superautomatic Espresso Machines">Egro Superautomatic Espresso Machines <br />        
    <input type="radio" name="equipment" id="radio" value="Mazzer/Swift Espresso Grinders/Dosers">Mazzer/Swift Espresso Grinders/Dosers<br />
    <input type="radio" name="equipment" id="radio" value="Blendtec Blenders">Blendtec Blenders <br />        
    </p>


    <p>I am interested in learning more about the following products:<br />
    <input type="radio" name="products" id="radio1" value="" title="" />Espressions Coffees/Teas<br />
    <input type="radio" name="products" id="radio1" value="" title="" />Monin All-Natural Syrups, Sauces &amp; Frappes <br />
    <input type="radio" name="products" id="radio1" value="" title="" />Big Train Frozen Drink Bases<br />
    <input type="radio" name="products" id="radio1" value="" title="" />Pacific Natural Foods Soy/Vanilla Soy, Smoothie Bases, Almond Milk<br />        
    <input type="radio" name="products" id="radio1" value="" title="" />Two Leaves and a Bud Tea Sachets<br />
    <input type="radio" name="products" id="radio1" value="" title="" />Umpqua Oats<br />
    </p>     

    <p>I am interested in learning more about your barista training program:
    <input type="radio" name="barista training no" id="radio" value="No" title="Check No if you are not interested" />No
    <input type="radio" name="barista training yes" id="radio2" value="Yes" title="Check Yes if you are interested" />Yes</p>  

    <p>Questions/ Comments:
    <input type="text" name="other2" value="" size="40" />
    </p>

    <p><input type="submit" value="Send" />

    <input type="reset" value="Reset" /></p>

  </form><br /><br /> 

Here is my code for sendmail.php:

// values from POST data
$name = $_POST['name'];
$title = $_POST['title'];
$company = $_POST['company'];
$email = $_POST['email'];
$website = $_POST['website'];
$address = $_POST['address'];
$city = $_POST['city'];
$State = $_POST['State'];
$zip = $_POST['zip'];
$equipment = $_POST['equipment'];
$products = $_POST['products'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$operation = $_POST['operation'];
$other = $_POST['other'];
$newsletter = $_POST['newsletter'];
$click1 = $_POST['click1'];
$click2 = $_POST['click2'];
$click3 = $_POST['click3'];
$click4 = $_POST['click4'];
$click5 = $_POST['click5'];
$click6 = $_POST['click6'];
$push1 = $_POST['push1'];
$push2 = $_POST['push2'];
$push3 = $_POST['push3'];
$push4 = $_POST['push4'];
$push5 = $_POST['push5'];
$push6 = $_POST['push6'];



// subject
$subject = 'Espressions Coffee Roastery Contact Form';

// message
$message = '
<html>
<head>
  <title>Espressions Coffee Roastery Contact Form</title>
</head>
<body>
  <p>Name: '.$name.'</p>
  <p>Title: '.$title.'</p>
  <p>Company: '.$company.'</p>
  <p>Email: '.$email.'</p>
  <p>Website: '.$website.'</p>
  <p>Address: '.$address.'</p>
  <p>city: '.$city.'</p>
  <p>State: '.$State.'</p>
  <p>Zip Code: '.$zip.'</p>
  <p>Phone: '.$phone.'</p>
  <p>Fax: '.$fax.'</p>
  <p>Operation: '.$operation.'</p>
  <p>Other: '.$other.'</p>
  <p>Newsletter: '.$newsletter.'</p>
  <p>questions: '.$other2.'</p>
  <p>BUNN Commercial: '.$click1.'</p>
  <p>La Marzocco: '.$click1.'</p>
  <p>Ranchilio Traditional: '.$click1.'</p>
  <p>Egro Superautomatic: '.$click1.'</p>
  <p>Mazzer/ Swift Espresso: '.$click1.'</p>
  <p>Blendtec Blenders: '.$click1.'</p>
  <p>Espressions: '.$push1.'</p>
  <p>Monin All-Natural: '.$push1.'</p>
  <p>Big Train Frozen Drink: '.$push1.'</p>
  <p>Pacific Natural Foods: '.$push1.'</p>
  <p>Two Leaves and a Bud: '.$push1.'</p>
  <p>interested in products: '.$radio.'</p>
  <p>interested in services: '.$radio1.'</p>





</body>
</html>
';

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

// Additional headers
$headers .= 'To: Espressions Coffee Roastery <max@estudioray.com>' . "
";
$headers .= 'From: Espressions Coffee Roastery Contact Form <max@estudioray.com>' . "
";

// Mail it
mail($to, $subject, $message, $headers);
  • 写回答

1条回答 默认 最新

  • doucang9673 2011-10-04 12:31
    关注

    Think the problem is here:

    <p>interested in products: '.$radio.'</p>
    <p>interested in services: '.$radio1.'</p>
    

    It should be:

    <p>interested in products: '.$products.'</p>
    <p>interested in services: '.$equipment.'</p>
    

    You've used the id attribute of the radio element and not the name attribute in your email code when you should just use what you have set it to at the top of your sendmail.php script which is $products and $equipment.

    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)