Jump to content

my first 'class'


ginerjm

Recommended Posts

ok - I lifted some code to help identify the client's browser (damn iphone doesn't like my "select" tag).

 

The code was this class definition and was followed by a couple lines showing how to use it.  Here are the two lines:

$browser = new Browser ; 
echo "Using: $Browser->Name $Browser->Version" ; 

 

When I include the class and add these two lines to my script all I get is the word "using:' displayed.

 

Is it possible that the writer of this code left something out?  I don't know what the syntax of the  "x->y" references are, but shouldnt' there be a call to functions within the class?

 

 

Link to comment
https://forums.phpfreaks.com/topic/231721-my-first-class/
Share on other sites

I just came back online to post that I had solved this - only to see the very first response telling me the same thing.

The code was all lifted from a posting I found online, so it wasn't my fault.  I did finally see it though after doing some reading on how classes worked.

 

Thanks for the quick response tho!

Link to comment
https://forums.phpfreaks.com/topic/231721-my-first-class/#findComment-1192298
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.