Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Undefined private variables
- class data_base //helps handling permissins
- {
- private $host;
- private $user;
- private $password;
- public function feed_data($hst, $usr, $pwd)
- {
- $host=$hst;
- $user=$usr;
- $password=$pwd;
- }
- public function get_data()
- {
- $info=array("host"=>" ", "user"=>" ", "password"=>" ");
- $info['host']=$host;
- $info['user']=$user;
- $info['password']=$password;
- return $info;
- }
- }
- $user1=new data_base;
- $user2=new data_base;
- $user1->feed_data("localhost", "root", ""); //enter details for user 1 here
- $user2->feed_data("", "", ""); //enter details for user 2 here
- $perm_add=$user1->get_data();
- $perm_view=$user2->get_data();
- $this->host;
- // instead of
- $host;
- $info=array("host"=>" ", "user"=>" ", "password"=>" ");
- $info['host']=$host;
- $info['user']=$user;
- $info['password']=$password;
- return $info;
- return array(
- 'host' => $this->host,
- 'user' => $this->user,
- 'password' => $this->password
- );
Add Comment
Please, Sign In to add comment