Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP将Google Recaptcha发送到DB_Php_Html_Recaptcha - Fatal编程技术网

使用PHP将Google Recaptcha发送到DB

使用PHP将Google Recaptcha发送到DB,php,html,recaptcha,Php,Html,Recaptcha,你好,我很难让验证码正常工作。我的表格正在发送给我的DB。即使没有检查验证码,我也可以提交表格。我将表单发送到另一个页面,然后将内容发送到DB <form id="x" name="x" method="post" onsubmit="return validate()" action="submit.php"> <h3>Enter Comment Here</h3> <div class='col-sm

你好,我很难让验证码正常工作。我的表格正在发送给我的DB。即使没有检查验证码,我也可以提交表格。我将表单发送到另一个页面,然后将内容发送到DB

<form id="x" name="x"  method="post" onsubmit="return validate()" action="submit.php">
            <h3>Enter Comment Here</h3>
            <div class='col-sm-8'>
                Name:* <input type="text" placeholder="Enter a Name" name="name" /> 
                <br />
                <br />
            </div>

            <div class='col-sm-8'>
                <textarea spellcheck="true" cols="50" rows="5" style='width:100%;' placeholder="Comment Here..." id='user_comment'  name="user_comment"></textarea>
            </div>
            <div class='clear'></div>
            <br />
            <div class='row'>
                <div class="g-recaptcha" data-sitekey="THIS IS MY SITE KEY">
                </div>
            </div>
            <br />
            <div class='padding-left-15'>
                <input type="submit" name="submit" id="submit" value="Submit" />
            </div>
            </form>

在此处输入注释
姓名:*




这就是我提交表单内容的方式

<?php 
require("connect.php");
$sql="INSERT INTO comments(comment_id, user_comment, name, time)
VALUES (NULL, '$_POST[user_comment]', '$_POST[name]', NULL)";

if (!mysql_query($sql,$con))
{
   die('Error: ' . mysql_error());
}       
?>