FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » classes in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: classes in PHP [message #180293 is a reply to message #180274] Mon, 04 February 2013 07:15 Go to previous message
Simon is currently offline  Simon
Messages: 29
Registered: February 2011
Karma:
Junior Member
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: change a string where have number after a word
Next Topic: Problem with readdir and ssh2
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 22:07:55 GMT 2024

Total time taken to generate the page: 0.04465 seconds