Jump to content

boarderstu

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

boarderstu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. im using PHP 4.3.3 on fedora core 3 or 4 (i think) and now have the revised code to: [code]<?PHP          $thumbdir = "photos/".$_GET['folder']."thumbs/";         $imagedir  = "photos/".$_GET['folder'];         $image  = $imagedir.$_GET['image'];         $MAX = 200;         $Start = $_GET['start']; class Gallery {         private $thumbdir = "photos/".$_GET['folder']."thumbs/";         private $imagedir  = "photos/".$_GET['folder'];         private $image  = $imagedir.$_GET['image'];         private $MAX = 200;         private $start = $_GET['start'];         private $end; function __construct($thumbdir,$imagedir,$image,$start,$end = $start+$max)         {         $this->thumbdir = $thumbdir;         $this->imagedir = $imagedir;         $this->image = $image;         $this->MAX = $end;         $this->displayStart = $start;         $this->displayEnd = $end;         }// end construct function display()     {         return $this->thumbdir;     } } //end the class $gal = new Gallery($thumbdir,$imagedir,$image,$start,$MAX); $gal->display(); ?>[/code] however this code is for php5 as im using a Core PHP Programming (revised for pHP5). how would i go about changing this to php4? many thanks
  2. [!--quoteo(post=371644:date=May 5 2006, 07:44 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ May 5 2006, 07:44 PM) [snapback]371644[/snapback][/div][div class=\'quotemain\'][!--quotec--] I don't know for sure, but why don't you use the inputs to the constructor here instead of reading from $_GET ? ie: [code] function __construct($thumbdir,$imagedir,$image,$start,$end = 200)         {         $this->thumbdir = $thumbdir;         $this->imagedir = $imagedir;         $this->image = $image;         $this->MAX = $end;         $this->displayStart = $start;         $this->displayEnd = $end;         }// end construct [/code] EDIT BY OBER: fixed your code block [/quote] no im afraid the error is still there. there error occurs when i declare my private variables.
  3. right so i have a gallerly that i created in PHP, and have recently studied OOP in JAVA at university, so i decited to convert all my PHP gallery code to OO to make it easier to handle. this is not as easy as it seems. i started small with the following code and i get the follow error. [code] <?PHP  class Gallery   {         private $thumbdir;         private $imagedir;         private $image;         private $MAX;         private $displayStart;         private $displayEnd; function __construct($thumbdir,$imagedir,$image)         {         $this->thumbdir = "photos/".$_GET['folder']."thumbs/";         $this->imagedir = "photos/".$_GET['folder'];         $this->image = $imagedir.$_GET['image'];         $this->MAX = "200";         $this->displayStart = $_GET['start'];         $this->displayEnd = "200";         }// end construct function display()     {         return $this->thumbdir;          }      } //end the class $gal = new Gallery; $gal->display();[/code] [code] Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /var/www/html/stu/Gallery/photos-oo.php on line 17[/code] anybody got any advice to offer or some good OOPHP sites? thanks in advance, im going to work. :) bye guys!
×
×
  • 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.