PDA

View Full Version : Need some help with a hack im making. : (


Guest190829
02-20-2005, 07:01 PM
Okay, so I'm making a hack and I need to use some of PHP OO features

Ie

$contents->title

And some of this is with an array

Ie

$contents[$i]->title

This is where the problem is. When I the page loads I just get

->title

and nothing else....

the $contents[$i]->title is in the templates not the php file. Anyone have any ideas how I can fix this?

Dean C
02-20-2005, 07:25 PM
Looks like you're not using OOP correctly. An object itself can't be an array. But it's properties can.

So $contents[$i]->title is technically impossible.

Guest190829
02-20-2005, 07:46 PM
I don't know if I'm explaining it correctly. The code works when I hardcode it, but when I put it in templates it doesn't work.

I'm using someones elses code and integrating it with vb

I then use a simple form asking for a zip code and access all the data with
examples I used from my first post. Again it works when I hardcode it. :ermm:

Marco van Herwaarden
02-21-2005, 03:30 AM
Isn't this what you're looking for:
$contents[$i]['title']

Guest190829
02-21-2005, 04:06 AM
^^^

I'll try that right now. :up: