The setup installs the following software:
The setup installs the following software:
- Apache
- MySQL
- PHP
- Node
<?php | |
function validar_cpf($cpf) | |
{ | |
$cpf = preg_replace('/\D/', '', (string) $cpf); | |
// Valida tamanho | |
if (strlen($cpf) != 11) | |
return false; | |
<?php | |
// Inclui o arquivo class.phpmailer.php localizado na pasta phpmailer | |
require_once("phpmailer/class.phpmailer.php"); | |
// Inicia a classe PHPMailer | |
$mail = new PHPMailer(); | |
// Define os dados do servidor e tipo de conexão | |
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
$mail->IsSMTP(); // Define que a mensagem será SMTP |
<?php | |
// Encriptando a senha | |
$senha = 'ola mundo'; | |
$hash = Bcrypt::hash($senha); | |
// $hash = $2a$08$MTgxNjQxOTEzMTUwMzY2OOc15r9yENLiaQqel/8A82XLdj.OwIHQm | |
// Salve $hash no banco de dados | |
// Verificando a senha | |
$senha = 'ola mundo'; |
<?php | |
/** | |
* Bcrypt hashing class | |
* | |
* @author Thiago Belem <[email protected]> | |
* @link https://gist.github.com/3438461 | |
*/ | |
class Bcrypt { |
<?php | |
/* | |
Converte caracteres especiais em caracteres simples(ASCII). | |
Exemplos: ç > c, á > a, Á > A, etc... | |
*/ | |
function utf8_translit($string) { | |
$characters = array( | |
" " /* 00a0 'NO-BREAK SPACE' */ => " ", | |
"¡" /* 00a1 'INVERTED EXCLAMATION MARK' */ => "!", | |
"¢" /* 00a2 'CENT SIGN' */ => "c", |