www.webdeveloper.com
Results 1 to 3 of 3

Thread: Basic Class problem

  1. #1
    Join Date
    Jan 2011
    Posts
    20

    [RESOLVED]Basic Class problem

    Hey guys,

    Right here is my problem, This is so basic I really don't know why it is not working!

    Here is my code:

    PHP Code:
    <?php
    class ShopProduct{
        public 
    $title 'Default product name';
        public 
    $producerMainName 'main name';
        public 
    $producerFirstName 'first name';
        public 
    $price 0;
    }

    $product1 = new ShopProduct();
    echo 
    $product1->title;
    ?>
    And all that is outputted is:

    PHP Code:
    title?> 
    Why??? I'm confused

    Thanks in advanced!

    Rich Hawkes
    Last edited by RJhawkes; 04-04-2011 at 05:24 PM. Reason: RESOLVED

  2. #2
    Join Date
    May 2010
    Posts
    123
    Hi,

    Are you sure you are not having the same problem as this thread:
    http://www.webdeveloper.com/forum/sh...d.php?t=243807

    I get the same results as what you say when I tested it using the file:// method

  3. #3
    Join Date
    Jan 2011
    Posts
    20
    Ohh exact same problem I didn't realize I had to upload it to my 127.0.0.1 thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles