通过电子邮件发送html表格电台结果?

时间:2013-02-18 17:02:37

标签: php html

有人可以帮助我试图通过电子邮件从我的表格发送4个电台盒的结果。我收到的电子邮件很好,但我没有收到结果。

有人能告诉我我做错了什么吗?

html表格:

<html>
<head>
<title>Site Feedback</title>
</head>
<body>
<form name="myform" action="send_feedback.php" method="POST">
<div  class="wrapper_feedback" align="left">
  <p>Website Design:</p>
    <input type="radio" name="design" value="design1"> 
    1
    <input type="radio" name="design" value="design2"> 
    2
    <input type="radio" name="design" value="design3" checked> 
    3
     <input type="radio" name="design" value="design4"> 
    4
     <input type="radio" name="design" value="design5"> 
    5
  </p>
  <hr>
<p>Ease of Use:</p>
    <input type="radio" name="easeuse" value="ease1"> 
    1
    <input type="radio" name="easeuse" value="ease2"> 
    2
    <input type="radio" name="easeuse" value="ease3" checked> 
    3
     <input type="radio" name="easeuse" value="ease4"> 
    4
     <input type="radio" name="easeuse" value="ease5"> 
    5
  </p>
    <hr>
<p>Fit for Purpose:</p>
    <input type="radio" name="purpose" value="purpose1"> 
    1
    <input type="radio" name="purpose" value="purpose2"> 
    2
    <input type="radio" name="purpose" value="purpose3" checked>
    3     
    <input type="radio" name="purpose" value="purpose4"> 
    4
     <input type="radio" name="purpose" value="purpose5"> 
    5
  </p>
      <hr>
<p>Layout:</p>
    <input type="radio" name="layout" value="layout1"> 
    1
    <input type="radio" name="layout" value="layout2"> 
    2
    <input type="radio" name="layout" value="layout3" checked>
    3     
    <input type="radio" name="layout" value="layout4"> 
    4
     <input type="radio" name="layout" value="layout5"> 
    5
   </p>
   <input type="submit" action="submit" value="submit" name="submit">
  <br>
</div>
</form>
</body>
</html>

PHP:

<?php ob_start(); ?>
<?php
/* Set e-mail recipient */
$myemail  = "info@mydomain.com";

$subject = "site Feedback";

/* Let's prepare the message for the e-mail */
$message = "somesite.com Feedback

$design
$easeuse
$purpose
$layout

End of message
";

/* Send the message using mail() function */
mail($myemail, $subject, $message);

/* Redirect visitor to the thank you page */
$_SESSION['feedback']="<div class=\"infobox-index\"><strong>Thank You</strong> - We appreciate you taking the time to tell us what you think.</div>"; 
header("Location: {$_SERVER['HTTP_REFERER']}");
exit();
?>
<?php ob_end_flush() ?>

3 个答案:

答案 0 :(得分:1)

您的代码依赖于Register Globals,该代码已被弃用且不鼓励。您应该使用以下方式访问数据:

$_POST['design']

$design

答案 1 :(得分:0)

而不是这些变量:

$design
$easeuse
$purpose
$layout

使用它:

$_POST['design']
$_POST['easeuse']
$_POST['purpose']
$_POST['layout']

答案 2 :(得分:0)

您需要使用以下语法访问从表单发送的POST变量:

$_POST['design']
$_POST['easeuse']
$_POST['purpose']
$_POST['layout']