Jump to content


Check out our Community Blogs

njr1489

Member Since 14 Mar 2008
Offline Last Active Jul 18 2011 02:59 PM
-----

Posts I've Made

In Topic: PHP foreach() exception to the rule.

18 July 2011 - 02:59 PM

You're using the triple equals operator on the conditional which I find odd. Wouldn't == just do the trick since you're just checking for a string? And as WingedPanther said, you're not using your original $image_url. That variable should be assigned to $portfolio_item I take it.

In Topic: Sessions make a page go... White?

26 June 2011 - 12:27 PM

Have you checked your PHP error log? Sometimes it will show errors your pages won't show.

In Topic: PHP Framework Doubt

13 June 2011 - 11:22 AM

Frameworks are built so that you code in a certain way (their way), resulting to what the authors believe would help you write faster code. If you're talking about intermingling two frameworks into one, that doesn't seem safe as each of them would most likely have code that accomplishes the same thing but in a different way.

What you can do, is if those frameworks provide loosely coupled components (things you could use in just standard PHP). For example, you can use the Zend Framework, which has tons of functionality out of the box, and use the Symfony components in your Zend Library. There, I can write all the PHP code under Zend, and yet use something like Symfony's Dependency Injection components. It's a cool setup.

In Topic: variable declaration - undefined

03 May 2011 - 06:10 AM

Here's an answer about your keyword var: What does PHP keyword 'var' do? - Stack Overflow

The var keyword is no longer needed in PHP. PHP is a loosely typed language, meaning you don't have to declare a variable's type before using it. That being said, the keyword var is different from the variable $var. Also $var1 is not the same as $var.

In Topic: PHP Class using another class, variable doesnt handles function

29 March 2011 - 10:10 AM

On line 10, you spelled your class variable wrong. It should be
$this->tmdb = [COLOR=#000000][COLOR=#0000BB][/COLOR][COLOR=#007700] new [/COLOR][COLOR=#0000BB]TMDb[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000BB]MovInfo[/COLOR][COLOR=#007700]::[/COLOR][COLOR=#0000BB]API_KEY[/COLOR][COLOR=#007700]); [/COLOR][/COLOR]

What happens is that even though the property on that class was never declared, it will still create a property on that object to whatever you try to call. So on line 25, it expected tmdb to be an object and currently it's not set to any value.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download