OK, so I am a total noob to PHP (and pretty much to HTML). I am trying to implement a simple PHP class, but am facing a roadbloack. By simply including or requiring my simple class, my page is broken in the browser (and incidentally, fails to validate). The class simply has 3 public properties, no functions as of yet. I have added the class to the php code of a page that works perfectly and validates to XHTML strict...until i include the class, in any of the following fashions:
1. include "box.php";
2. include( "box.php" );
3. require - with and without parenthesis
4. require_once - with and wothout
5. ..... you get the picture
Any of these one liners breaks my page, and I can't figure why. I tried instantiating the class into an object, to no avail. Is there some secret about using classes in PHP that I need to know? My books and online docs on the subject mention nothing that I find readily.
A couple of notes: the box.php code resides in the same path as the index.php code that tries to call it and the actual text of the class is shown below.
<?php
class box
{
public $bgcolor;
public $txtcolor;
public $brdrcolor;
}
?>
Any help would be most appreciated.
Erik
|