Last active
April 5, 2018 14:55
-
-
Save IsaiChristian/7daa38a422b698f49b8441e8b9ae539b to your computer and use it in GitHub Desktop.
Agregar Captcha Formulario #Captcha #ps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Dale un espacio*/ | |
.g-recaptcha { | |
margin-bottom: 30px; | |
display: flex; | |
justify-content: center; | |
} | |
/*Que se vea bien en mobil*/ | |
@media screen and (max-height: 575px){ | |
#rc-imageselect, | |
.g-recaptcha { | |
transform:scale(0.77); | |
-webkit-transform:scale(0.77); | |
transform-origin:0 0;-webkit-transform-origin:0 0;} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='https://www.google.com/recaptcha/api.js'></script> | |
<div class="g-recaptcha" data-sitekey="6LcLQVEUAAAAANMCQeYiiWW8VYFb2h3zcE0ONOfN"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Tools::isSubmit('submitMessage')) { | |
$extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); | |
$file_attachment = Tools::fileAttachment('fileUpload'); | |
$message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags. | |
$id_order = (int)$this->getOrder(); | |
if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) { | |
$this->errors[] = Tools::displayError('Invalid email address.'); | |
// add the 2 lines from here | |
} elseif (!($gcaptcha = (int)(Tools::getValue('g-recaptcha-response')))) { | |
$this->errors[] = Tools::displayError('Captcha error'); | |
// to here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment