Hi I am trying to explore the class & object facilities written into PHP.
I have a new 64bit computer with a quad processor running on a Windows vista Business OS, I have loaded PHP v5.2.14 which may or may not have all of the required configuration file extensions included. I am using IIS.
I have written two PHP files, one which contains only the class code and another which calls it and displays the value of the class property (one only to begin with for simplicity).
File product.php
<?php
class Ch2_Product
{
// properties defined here
// protected $_type = 'Book';
// methods defined here
// public function getProductType()
// {
// return $this->_type;
// }
// public function setProductType($type)
// {
// $this->_type = $type;
// }
}
File product_test.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.3.org/1999/xhtml">
<head>
<title>Experimenting with visability</title>
<meta http-equiv="content-type"
content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
// include the class file
require_once 'Product.php';
// require_once(dirname(__FILE__) . "Product.php");
// create an instance of the Ch2_Product class
$product = new Ch2_Product();
// display the $_type property
// echo $product->_type;
</body>
</html>
launching the file called product_test I get a 500 error message (not able to display the page. I have edited out most of the code to try and find the source of the error without success and now wonder if there is something further required doing with the configuration file, todate the only extensions activated are the two mysql extensions (Which I am not using yet) The extension_dir & session.save_path have both been set.
Has anyone in this forum covered this ground and can offer a suggestion why the page cannot be displayed?
Thanks for any assistance in anticipation.