Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public function smCreateCookie()
  2. {
  3. setcookie("smclient", $this->contactId,time()+86400*3650, "/");
  4. }
  5.  
  6. public function getContactId()
  7. {
  8. return $this->contactId;
  9. }
  10.  
  11. if(!empty($data) && filter_var($data->email, FILTER_VALIDATE_EMAIL)) {
  12.  
  13. $email = $data->email;
  14.  
  15. if(!empty($data->name)) $name = $data->name;
  16. else $name = "";
  17.  
  18. if(!empty($data->phone)) $phone = $data->phone;
  19. else $phone = "";
  20.  
  21. if(!empty($data->note)) $note = $data->note;
  22. else $note = "";
  23.  
  24. $contact = new Register($email, $name, $phone, $note);
  25. if(!empty($contact->getContactId())) {
  26. $contact->smCreateCookie();
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement