<?php
require_once("validator_class.php");
if(isSet($_POST['validar']))
{
$nome = $_POST['nome'];
$email = $_POST['email'];
$v= new validation();
#$v->is_empty(array("nome"=>$nome,"email" => $email),true);
$v->is_email($email);
#$v->is_secure_pwd($nome);
#$v->msg_length($nome,10);
#$v->empty_spaces(array("nome" => $nome));
$v->bad_words(array("nome" => $nome));
}
?>
<html>
<head>
<title>Validator Class</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="<?=$_SERVER['PHP_SELF']?>">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td>Nome:</td>
<td ><input type="text" name="nome"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>Assunto</td>
<td><input type="text" name="assunto" value="<?if(!empty($_POST['assunto'])){echo $_POST['msg'];}?>"></td>
</tr>
<tr>
<td valign="top">Messagem:</td>
<td><textarea name="msg"><?if(!empty($_POST['msg'])){echo $_POST['msg'];}?></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="validar" value="Enviar email"></td>
</tr>
</table>
</form>
</body>
|