File: test_validator_4fields

Recommend this page to a friend!
  Classes of Josť Augusto Ferreira Franco  >  Validator4Fields  >  test_validator_4fields  >  Download  
File: test_validator_4fields
Role: Example script
Content type: text/plain
Description: Test script
Class: Validator4Fields
Validate values against several types of rules
Author: By
Last change:
Date: 13 years ago
Size: 1,474 bytes


Class file image Download


$nome = $_POST['nome'];
$email = $_POST['email'];

$v= new validation();
#$v->is_empty(array("nome"=>$nome,"email" => $email),true);
    #$v->empty_spaces(array("nome" => $nome));
$v->bad_words(array("nome" => $nome));


<title>Validator Class</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
      <table border="0" cellspacing="0" cellpadding="2">
            <td ><input type="text" name="nome"></td>
            <td><input type="text" name="email"></td>
            <td><input type="text" name="assunto" value="<?if(!empty($_POST['assunto'])){echo $_POST['msg'];}?>"></td>
            <td valign="top">Messagem:</td>
            <td><textarea name="msg"><?if(!empty($_POST['msg'])){echo $_POST['msg'];}?></textarea></td>
            <td><input type="submit" name="validar" value="Enviar email"></td>


For more information send a message to info at phpclasses dot org.