Jump to content
Larry Ullman's Book Forums

gmgj

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by gmgj

  1. My first choice was XAMPP; however, on install it recommended essentially dropping UAC.  If something needs elevated permissions, I don't mind using the little sudo type box to say its okay.  So I went with Bitnami.  I used the Bitnami forums and got a nice informative reply to my question.  I installed the Directory Listing Script  by Ash Young at www.evoluted.net as my web start page and I can use it in much the same way as I used PHPEasy. 

  2. I started out using EasyPHP.  Its been very helpful getting me accustomed to PHP syntax and conventions.  One of the problems with Easy is that its not super simple to install things like pear etc.

     

    I have done a little research and am considering Bitnami, Zend Community edition and xampp. If you want to share pros and cons, please do.  I briefly considered installing multiple WAMPS for the same user until I came to the realization that I would probably have multiple php.exe and the first one found in the path would be the one executed.

     

    I am adding packages and addons and tools that should easily work with the chosen distro

     

    Zend
    Pear
    Curl
    Expat
    xdebug
    WebCodeSniffer
     

  3. class CSESSION
    {
        //initialize strings
        public $City = '';
        public $State = '';
        public $Where = ''

    ..

        // Constructor:
        public function __construct($ip)
        {
            $this->IP = $ip;
            $this->getIPinfo($ip);  //constuctors don't return anything
        }

     


        protected function getIPinfo($ip)
        {
            // Identify the URL to connect to:
            $url = 'http://freegeoip.net/csv/'.$ip;

            // Open the connection:
            $fp = fopen($url, 'r');
            if (!$fp) {
                    echo "Error opening url:".$url." for ip: ".$ip."<BR>";
                    return false;
            }

     

    ---------------------------------------

     

    My contstructor calls a function which returns a value if a connection can't be made 

    But contstructor cannot have a return statement.

     

    I thought I would use the class like this


    // Create it new object:
    $cs = new CSession($ip);

    if ($cs->where) {
    ------------------------------------

    Can I get a hint how an experienced php oop guy might do this?

     

     

×
×
  • Create New...