Jump to content

Bendude14

Members
  • Posts

    411
  • Joined

  • Last visited

    Never

Posts posted by Bendude14

  1. That is how you would use getters and setters but if everytime you create a CHFourInvest Object you will be setting $interest, $initial and $end then you should still be passing these into the constructor like you were before.

     

    A constructors purpose is to initialise the object, "like a preparation stage".

     

    getters and setters give you access to private data, in case you need to update the data or retrieve the data from the object later on.

     

    You provide getters and setters because other people may not no how to edit your data correctly and should therefore use the methods provided.

     

    Yes making a method private would only allow access to it from within the same class

     

    Did you look at the php __set() and __get() will save you some time in the long run ;)

  2. You do not want your constructor to be private or methods that you would like to use from outside of the class.

     

    Google, access modifiers to learn a bit more about this.

     

    You should set your data to private so it can only be accessed through getter and setter methods you create. Encapsulation is a key part of OO programming.

     

    PHP has some "magic" methods you may want to look into

     

    __get() and __set()

     

    http://au.php.net/manual/en/language.oop5.overloading.php

  3. have you checked the HTML source code to see whats appearing?

     

    you might need to use htmlentities when printing the data back to the page.

     

    As for Global warming - Who cares lol?

    as for Women the secret is to keep swapping the old out with the new, example

     

    if($women['days']) < 7)
    {
        keepDating();
    }
    else
    {
        findNewWomen("blonde", "bigtits");
    }
    

     

    Ben

  4. if your array was called $info then simply use

     

    $info['site'] = "myspace.com";

     

    Since you have an array of sites you can use the array index first like so

     

    $info[0]['site'];

     

    Remeber arrays start from 0 so this would be your first array.

     

     

     

     

  5. Well after a few hours of searching I can not find a program to allow me to password protect my scanner utility from been opened while it is running.

     

    Can anyone point me in the direction of creating an application to do something similar to this, Its a 3rd party app so can not get the source code.

     

    Preffered language for doing this would be, VB.NET or C#

     

    Thanks

    Ben

  6. wouldn't this line set a cookie with either true or false on the clients machine, depending on wether or not the session started?

     

    setcookie('aff_ses', session_start());

     

    Shouldn't you been saving the session id on the clients machine?

     

    session_start();

    setcookie( 'aff_ses', session_id() );

×
×
  • 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.