0

やあみんな、誰かが私を助けることができれば私はそれが大好きだ...

私が持っているのは、送信されたフォームで、doublecheck.phpを使用しています

<?php  
    require_once('recaptchalib.php');  
    $privatekey = "";  
    $resp = recaptcha_check_answer ($privatekey,  
    $_SERVER["REMOTE_ADDR"],   
    $_POST["recaptcha_challenge_field"],  
    $_POST["recaptcha_response_field"]);  
    if (!$resp->is_valid) {  
        die ("Sorry please go back and try it again." .  
            "" . $resp->error . ")");  
    }  
    if ($resp->is_valid) {  
        require_once('sendmail.php');  
    }    
?>

そして、私のsendmail.php

<?php

    $ip = $_POST['ip'];
    $httpref = $_POST['httpref'];
    $httpagent = $_POST['httpagent'];
    $visitor = $_POST['visitor'];
    $notes = $_POST['notes'];
    $attn = $_POST['attn'];

    $todayis = date("l, F j, Y, g:i a");

    $attn = $attn ;
    $subject = $attn;

    $notes = stripcslashes($notes);

    $message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($Your Prayer or Concern)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

    $from = "From:\r\n";

    mail("", Prayers and Concerns, $message);

?>

<p align="center">
Date: <?php echo $todayis ?>
<br />
<br />

Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>

<br /><br />
<a href="contact.php"> Next Page </a>
</p>
</body>
</html>

私が苦労しているのは、成功したときに$ notesを送信する必要があるのに、$notesが常に空白になっている場合です。sendmail phpを成功したphpの中に入れるだけでいいですか?または、$notesが空白である理由を誰かが私に説明できますか。

私は自分のrecaptchaキーを持っています、そしてまた私は電子メールアドレスを持っています。私はいくつかのものを非公開にしました、また私のHTMLにメモテキストエリアがあります

これがそのテーブルの私のhtmlです:

<form action="doublecheck.php" action="http://www.ipower.com/scripts/formemail.bml" enctype="application/x-www-form-urlencoded" method="post">
  <table>
    <tbody style="font-size: 12px;">
      <tr>
        <td width="661">Your Prayer or Concern<br/>
          <textarea name="notes" rows="6" cols="100" maxlength="1024"></textarea></td>
      </tr>
      <tr>
        <td><script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LdoKLoSAAAAAChm6Oaquimz8g1elKd5OQBJtCLm"></script>

<noscript>
    <iframe src="http://api.recaptcha.net/noscript?k=6LdoKLoSAAAAAChm6Oaquimz8g1elKd5OQBJtCLm" height="300" width="500" frameborder="0"></iframe><br/>
    <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
    <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>                <p>
              <input type="submit" id="Pray" name="Pray" value="Send your prayer"/>
          </p></td>
      </tr>
      <tr>
      </tr>
    </tbody>

  </table>
</form>
4

1 に答える 1

1

Firefox 用の LiveHeaders プラグインを入手し、送信しているフォーム データを正確に調べて、メモ フィールドがあることを確認することをお勧めします。そうである場合は、var_dump を使用して $_POST 配列をダンプし、正しく受信されていることを確認してください。

Eclipse IDE 用のPHP 開発ツールプラグインには、非常に優れたデバッガーがあります。通常、この種の問題では、デバッグ コードを大量に追加するよりも、デバッガーでステップ実行する方が簡単です。

于 2010-05-30T04:14:03.993 に答える