Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function register2(){
- $objReg = new registration($_POST['username'],$_POST['password'],$_POST['email']);
- $objReg->register();
- unset($objReg);
- }
- class clean
- {
- public function process($data)
- {
- $data = trim($data);
- $data = stripslashes($data);
- $data = htmlspecialchars($data);
- return $data;
- }
- }
- class registration
- {
- // Registration stuffs
- private $regUser = NULL;
- private $regPass = NULL;
- private $regEmail = NULL;
- public function __construct($regName, $regPass, $regEmail)
- {
- //Set the class properties if they aren't NULL.
- if (!empty($regName) AND !empty($regPass) AND !empty($regEmail)){
- $objClean = new clean;
- $this->regUser = $objClean->process($regName);
- $this->regPass = $objClean->process($regPass);
- $this->regEmail = $objClean->process($regEmail);
- unset($objClean);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement