Adil
DevBest CEO
- May 28, 2011
- 1,278
- 716
PHP:
<?php
class Template
{
public $salt = "tVaCYSAqNu6yjlIXWmcotT2SXL2Zrrl";
public function secure($var)
{
return $this->mysql_real_escape($var);
return $this-trim($var);
return $this->stripslashes($var);
return $this->htmlspecialchars($var);
}
public function encrypt($var)
{
return $this->sha512($var . $salt);
}
}
//this is a basic template class, will add more later on. The sanitize function strips the given $_GET var
?>
PHP:
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email'];
$template->secure($username);
$template->encrypt($username);
$template->secure($password);
$template->encrypt($password);
$template->secure($email);
$template->encrypt($email);
?>