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 #180275 is a reply to message #180274] Sun, 03 February 2013 18:39 Go to previous messageGo to previous message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma:
Senior Member
Am 03.02.2013 18:49, schrieb Rita Ferreira:
> Hi,
> thanks for reply.
> The error I'm obtained is:
>
> Fatal error: Class 'config' not found in /Applications/MAMP/htdocs/admin_classes/UserController.php on line 10
>
> UserController.php
>
> <?php
>
> error_reporting(E_ALL);
> ini_set('display_errors', '1');
>
> 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";
> }

Please put your answer below the text. You are in the "usenet", read about it, and
use a news reader if you can.

The message says it all: class config is unknown. You must use
include/include_once/require/require_once to pull the definitions in.

You would never start a session somewhere inside the code, session_start() is the
first thing to do.

/Str.
[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: Tue Nov 26 07:50:57 GMT 2024

Total time taken to generate the page: 0.04494 seconds