I tried to protect myself from spam on the mail server (I use hmailserver and wampserver) using recaptcha v2 checkbox.
Everything goes normally but after sending the message I get a white screen with the error ,,Failed to update table!
Data too long for column 'GRECAPTCHARESPONSE' at row 1" instead of sending me to the web page with the message_ok.
I tried to delete the table from the database and publish the site again, but nothing happened. I guess it's a mistake to create the table in the database when publishing the contact.php page.
Recaptcha v2 in contact form
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901
MUST READ:
http://www.wysiwygwebbuilder.com/forms.html
http://www.wysiwygwebbuilder.com/form_wizard.html
Frequently Asked Questions about Forms
Re: Recaptcha v2 in contact form
I think you will have to update the database so it accepts more data.
Note that this is a free extension and it's provided as an extra service "AS IS". There is no support on free extensions.
Note that this is a free extension and it's provided as an extra service "AS IS". There is no support on free extensions.
Re: Recaptcha v2 in contact form
SOLVED !!!!
We have edited the database created for contact form in the sense that we have modified the first column called "TIP" of the GRECAPTCHARESPONSE string from varchar 255 in LONG TEXT and so the error was eliminated.
We have edited the database created for contact form in the sense that we have modified the first column called "TIP" of the GRECAPTCHARESPONSE string from varchar 255 in LONG TEXT and so the error was eliminated.
Re: Recaptcha v2 in contact form
Maybe the problem is here in contact form:
"$db = mysqli_connect($mysql_server, $mysql_username, $mysql_password) or die('Failed to connect to database server!<br>'.mysqli_error($db));
mysqli_query($db, "CREATE DATABASE IF NOT EXISTS $mysql_database");
mysqli_select_db($db, $mysql_database) or die('Failed to select database<br>'.mysqli_error($db));
mysqli_query($db, "CREATE TABLE IF NOT EXISTS $mysql_table (ID int(9) NOT NULL auto_increment, `DATESTAMP` DATE, `TIME` VARCHAR(8), `IP` VARCHAR(15), `BROWSER` TINYTEXT, PRIMARY KEY (id))");
foreach($form_data as $name=>$value)
{
mysqli_query($db ,"ALTER TABLE $mysql_table ADD $name VARCHAR(255)");
}
mysqli_query($db, "INSERT INTO $mysql_table (`DATESTAMP`, `TIME`, `IP`, `BROWSER`)
VALUES ('".date("Y-m-d")."',
'".date("G:i:s")."',
'".$_SERVER['REMOTE_ADDR']."',
'".$_SERVER['HTTP_USER_AGENT']."')")or die('Failed to insert data into table!<br>'.mysqli_error($db));
$id = mysqli_insert_id($db);
foreach($form_data as $name=>$value)
{
mysqli_query($db, "UPDATE $mysql_table SET $name='".mysqli_real_escape_string($db, $value)."' WHERE ID=$id") or die('Failed to update table!<br>'.mysqli_error($db));
}"
and most add option for use recaptcha extension and chance for "GRECAPTCHARESPONSE" to add LONG TEXT instead of VARCHAR(255)
"$db = mysqli_connect($mysql_server, $mysql_username, $mysql_password) or die('Failed to connect to database server!<br>'.mysqli_error($db));
mysqli_query($db, "CREATE DATABASE IF NOT EXISTS $mysql_database");
mysqli_select_db($db, $mysql_database) or die('Failed to select database<br>'.mysqli_error($db));
mysqli_query($db, "CREATE TABLE IF NOT EXISTS $mysql_table (ID int(9) NOT NULL auto_increment, `DATESTAMP` DATE, `TIME` VARCHAR(8), `IP` VARCHAR(15), `BROWSER` TINYTEXT, PRIMARY KEY (id))");
foreach($form_data as $name=>$value)
{
mysqli_query($db ,"ALTER TABLE $mysql_table ADD $name VARCHAR(255)");
}
mysqli_query($db, "INSERT INTO $mysql_table (`DATESTAMP`, `TIME`, `IP`, `BROWSER`)
VALUES ('".date("Y-m-d")."',
'".date("G:i:s")."',
'".$_SERVER['REMOTE_ADDR']."',
'".$_SERVER['HTTP_USER_AGENT']."')")or die('Failed to insert data into table!<br>'.mysqli_error($db));
$id = mysqli_insert_id($db);
foreach($form_data as $name=>$value)
{
mysqli_query($db, "UPDATE $mysql_table SET $name='".mysqli_real_escape_string($db, $value)."' WHERE ID=$id") or die('Failed to update table!<br>'.mysqli_error($db));
}"
and most add option for use recaptcha extension and chance for "GRECAPTCHARESPONSE" to add LONG TEXT instead of VARCHAR(255)