Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Created October 24, 2015 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dinamiko/a03856d6c892fe98c690 to your computer and use it in GitHub Desktop.
Save Dinamiko/a03856d6c892fe98c690 to your computer and use it in GitHub Desktop.
<?php
...
} else {
// comprobamos que existen
if( isset( $_POST['encuesta_radiochoices'] ) && isset( $_POST['encuesta_email'] ) ) {
$respuesta_length = strlen( $_POST['encuesta_radiochoices'] );
$email_length = strlen( $_POST['encuesta_email'] );
$valid_email = is_email( $_POST['encuesta_email'] );
// valida el máximo de carácteres permitido en cada string y si el email es válido
if( $respuesta_length <= 30 && $email_length <= 100 && $valid_email ) {
...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment