Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8227
| From | Simon <bad@example.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: classes in PHP |
| Date | 2013-02-04 09:15 +0200 |
| Message-ID | <an95goFbqvhU1@mid.individual.net> (permalink) |
| References | <fd3565a9-3766-4224-bed5-812a0cd11d64@googlegroups.com> <c42bd135-6e8f-46e3-be37-445b423ff529@googlegroups.com> |
On 2013/02/03 07:49 PM, Rita Ferreira wrote:
>
> class UserController
> {
>
> private $obj;
>
> function __construct( ){}
>
> public function login()
> {
> if($_SERVER["REQUEST_METHOD"] == "POST")
> {
> $obj=new config();
> $obj->conectar();
> }
...
>
> config.php
>
> <?php
>
> private $url_db;
> private $login_db;
> private $pass_db;
> private $db;
>
> class config
> {
>
> function __construct( )
> {
> session_start();
> $url_db="localhost";
> $login_db="root";
> $pass_db="root";
> $db="colmeia";
> }
>
> private function conectar()
...
>
Further to what was said already, the function 'conectar' is private and
cannot be accessed.
Simon
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
classes in PHP Rita Ferreira <ritaferreira83@gmail.com> - 2013-02-03 09:04 -0800
Re: classes in PHP "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-03 18:11 +0100
Re: classes in PHP Rita Ferreira <ritaferreira83@gmail.com> - 2013-02-03 09:49 -0800
Re: classes in PHP "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-03 19:39 +0100
Re: classes in PHP Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-04 00:07 -0500
Re: classes in PHP Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-06 13:29 +0100
Re: classes in PHP Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-06 08:49 -0500
Re: classes in PHP "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-07 11:57 +0100
Re: classes in PHP Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-07 12:17 +0100
Re: classes in PHP Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-07 12:35 +0100
Re: classes in PHP The Natural Philosopher <tnp@invalid.invalid> - 2013-02-07 11:46 +0000
Re: classes in PHP "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-07 14:46 +0100
Re: classes in PHP Simon <bad@example.com> - 2013-02-04 09:15 +0200
csiph-web