First foray into OOP: Correct implementation?

  • (8 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • 8

113 Replies - 8334 Views - Last Post: 23 March 2013 - 11:52 PM Rate Topic: -----

#91 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 12 March 2013 - 11:24 PM

well then, Id remove it and check with var_dump() the status of $Check in every concerned script.
Was This Post Helpful? 0
  • +
  • -

#92 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 05:53 AM

Aye captain! :)

Checking now!
Was This Post Helpful? 0
  • +
  • -

#93 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:03 AM

Alright, it looks like it's in there.

object(content)[9]
  protected 'Check' => 
    object(check)[3]
      protected 'pdo' => 
        object(PDO)[2]


Was This Post Helpful? 0
  • +
  • -

#94 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:07 AM

is that the $Check variable?
Was This Post Helpful? 0
  • +
  • -

#95 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:36 AM

Yepper
Was This Post Helpful? 0
  • +
  • -

#96 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:44 AM

and the loggedIn() method belongs to the check class? then $Check->loggedIn() must fail since $Check is an instance of content.
Was This Post Helpful? 0
  • +
  • -

#97 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:53 AM

Wait, I'm sorry. I misread your question. I am incorrect, that is the $Content variable.

Here is Check.

object(check)[3]
  protected 'pdo' => 
    object(PDO)[2]


Was This Post Helpful? 0
  • +
  • -

#98 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 06:54 AM

is that from navbar.inc.php?
Was This Post Helpful? 0
  • +
  • -

#99 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 07:01 AM

Yes
Was This Post Helpful? 0
  • +
  • -

#100 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 07:04 AM

hm. do you still get the error?
Was This Post Helpful? 0
  • +
  • -

#101 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 07:09 AM

Yep. No change.

If I am not logged in and try to access a protected page it gives the undefined error, and if I am logged in and try to access a page logged in users aren't supposed to access it gives the same error.
Was This Post Helpful? 0
  • +
  • -

#102 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 07:14 AM

is the creation of the $Check variable based upon any condition?
Was This Post Helpful? 0
  • +
  • -

#103 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 13 March 2013 - 07:27 AM

No, here is the code

$Check = new check($db);


Was This Post Helpful? 0
  • +
  • -

#104 Darkranger85  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 147
  • Joined: 31-August 12

Re: First foray into OOP: Correct implementation?

Posted 20 March 2013 - 12:18 PM

Alright, I'm trying to use FirePHP to debug the script but. . . I can't make heads or tails of how to use the darn thing.
Was This Post Helpful? 0
  • +
  • -

#105 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3617
  • View blog
  • Posts: 12,445
  • Joined: 12-December 12

Re: First foray into OOP: Correct implementation?

Posted 20 March 2013 - 01:27 PM

View PostDarkranger85, on 20 March 2013 - 07:18 PM, said:

Alright, I'm trying to use FirePHP to debug the script but. . . I can't make heads or tails of how to use the darn thing.

FirePHP seems intended for Ajax requests rather than general PHP debugging.

There are PHP debuggers available. I seem to recall that the one in NetBeans was the easiest to configure.

Personally I tend to regard them as more trouble than they are worth. Tactical use of print_r, var_dump, echoes, et al., together with enabling all error reporting, is quicker and easier. By the time you've struggled to configure, and learn to use, the debugger, you could have found the error with a few simple echoes :sorcerer:. I may be wrong (probably am in this regard) but I am suspicious that configuring the debugger itself could impact the way the page behaves - cf. Heisenberg :)

This post has been edited by andrewsw: 20 March 2013 - 01:39 PM

Was This Post Helpful? 0
  • +
  • -

  • (8 Pages)
  • +
  • « First
  • 5
  • 6
  • 7
  • 8