Advertisement
Guest User

Untitled

a guest
Jul 14th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. class test
  3. {
  4. private $server;
  5. private $db;
  6. private $user;
  7. private $pass;
  8.  
  9. function __construct($var1, $var2)
  10. {
  11.  
  12. // do something... validate var1 and var2
  13. // do $this->var1=$var1; etc
  14.  
  15.  
  16. }
  17.  
  18. // other functions
  19. ...
  20.  
  21. public function login($parameter1)
  22.  
  23. {
  24. $this->new=$parameter1;
  25.  
  26. my connection and here i would like to use
  27. $this->server,
  28. $this->db,
  29. ...
  30.  
  31. }
  32. }
  33.  
  34. ?>
  35.  
  36. <?php
  37. include 'connections.php';
  38. $class = new test(var1, var2);
  39. $class -> login($parameter1);
  40. ?>
  41.  
  42. <?php
  43.  
  44. $server = 'something';
  45. $db = 'something';
  46. $user = 'something';
  47. $pass = 'something';
  48.  
  49. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement