plz
someone check this registration code. It works with some of my classes. but in registration script it is sent empty value, esp when I made refresh. It gave me msg that username is already in database, and when I check database I find username, firstname and last name are empty vale. I don't need it to send empty value.
<?php
function MakeMechanism($USERNAME, $FIRSTNAME, $LASTNAME, $PWD, $PWD2, $EMAIL){
if(isset($_POST['submit'])){
if($this->USERNAME == "" || strlen($this->USERNAME) <= 3){
die('Hey, Your <font color = red><strong>username</strong></font> should not be empty and it should 3 characters!');
}
if($this->FIRSTNAME == ""){
die('Hey, Your <font color = red><strong>firstname</strong></font> should not be empty!');
}
if($this->LASTNAME == ""){
die('Hey, Your <font color = red><strong>lastname</strong></font> should not be empty!');
}
if($this->PWD != $this->PWD2 || strlen($this->PWD) <= 5){
die('Hey, Either your <font color = red><strong>password</strong></font> empty or did not match!');
}
if($this->EMAIL == "" || !eregi("^([[:alnum:]]|_|\.|-)+@([[:alnum:]]|\.|-)+(\.)([a-z]{2,4})$", $_POST['email'])){
die('Hey, Your <font color = red><strong>email</strong></font> should not be empty!');
}
return "{$this->USERNAME}".
"{$this->FIRSTNAME}".
"{$this->LASTNAME}".
"{$this->PWD}".
"{$this->EMAIL}";
}
}
?>