这是提交表格:
<form action="/upload.php" method="post" enctype="multipart/form-data">
<ul>
<li>
<?php echo $content['SubmitFormName'];?>*:
<br>
<input class="text" type="text" name="name">
</li>
<br>
<li>
<?php echo $content['SubmitFormEmail'];?>*:
<br>
<input class="text" type="email" name="email" placeholder="<?php echo $content['SubmitFormEmailPlaceholder'];?>">
</li>
<br>
<li>
<?php echo $content['SubmitFormFile'];?>*:
<br>
<input type="file" name="file">
<br>
<?php echo $content['SubmitFormOr'];?>
<br>
<?php echo $content['SubmitFormURL'];?>*:
<br>
<input class="text" type="text" name="url" placeholder="http://">
</li>
<br>
<li>
<?php echo $content['SubmitFormNotes'];?>:
<br>
<textarea class="text" name="notes" rows="5"></textarea>
</li>
<br>
<li>
Human Verification*:
<br>
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/resources/recaptchalib.php');
$publickey = "key";
echo recaptcha_get_html($publickey);
?>
</li>
<br>
<li>
<?php echo $content['SubmitFormAgreement'];?>
</li>
<br>
<li>
<input type="submit">
</li>
<br>
<li>
<?php echo $content['SubmitFormRequired'];?>
</li>
</ul>
</form>
这对我来说似乎并不寻常。回声代码仅包含文本,作为站点的多语言功能的一部分。也许它可能与enctype有关?不过,这应该是正确的。这是我能想到的唯一可能是这部分的问题。
以下是上传代码的一部分,与CAPTCHA相关:
require_once($_SERVER['DOCUMENT_ROOT'].'/resources/recaptchalib.php');
$privatekey="key";
$resp=recaptcha_check_answer($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);
if(!$resp->is_valid){
echo "<h1>".$content['UploadError']."</h1>".$content['UploadCaptcha']."<br><br>".$content['UploadReturn'];
}else{
//Begin upload process
上传mp4文件会产生以下消息:
Notice: Undefined index: recaptcha_challenge_field in /var/www/upload.php on line 14
Notice: Undefined index: recaptcha_response_field in /var/www/upload.php on line 14
之后,if(!$resp->is_valid)
部分开始并提供错误输入CAPTCHA的消息
这可能是什么问题?可能是视频太大(40MB左右)?对我没有意义。