php - Calling Array in Mail -


i working on project stucked :(

i following php academy oop login/register videos me alot complete project in there oop videos series there no email verification system, see have videos series covering email verification, problem that.

my code sending email when see email there no key :-

to: **@gmail.com

subject: activate account

from : ****@****.com

hello superman,

you need activate account

http://localhost:8080/****/developers/activate.php?email=******@gmail.com&key=

unique verification generating , saving in db automatically when register.

my code :-

if ($validate->passed()) {             $user = new user();             $salt = hash::salt(32);             $email_coder = md5(input::get('username') + microtime());             try {                     $user->create(array(                     'name' => input::get('name'),                     'username' => input::get('username'),                     'password' => hash::make(input::get('password'), $salt),                     'salt' => $salt,                     'email' => input::get('email'),                     'email_code' => $email_coder,                     'joined' => date('y-m-d h:i:s'),                     'group' => 3                 ));                     mail(input::get('email'), 'activate account', "hello                      ".input::get('name').",\n\nyou need activate account                      \n\nhttp://localhost:8080/****/developers/activate.php?                     email=".input::get('email')."&key=".$user->email_code."\n\n-*****", "from : ****@****.com");                 session::flash('home', 'welcome ' . input::get('username') .                  '! confirmation link has been sent email address.');                 redirect::to('login.php');             } catch(exception $e) {                 echo $error, '<br>';             }         } else {             foreach ($validate->errors() $error) {                 echo "<script type='text/javascript'>alert('$error');</script>";             }         }     } 

please me smile emoticon

also when try run print_r($user) got error

user object ( [_db:user:private] => db object ( [_pdo:db:private] =>  pdo object ( ) [_query:db:private] => pdostatement object ( [querystring] =>   insert users (`name`, `username`, `password`, `salt`, `email`,   `email_code`, `joined`, `group`) values (?, ?, ?, ?, ?, ?, ?, ?) )   [_error:db:private] => [_results:db:private] => array ( ) [_count:db:private]  => 1 ) [_data:user:private] => [_sessionname:user:private] => user  [_cookiename:user:private] => hash [isloggedin:user:private] => )  notice: undefined property: user::$email_code in    c:\xampp\htdocs\****\developers\register.php on line 53 


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -