Hi,
I’m having trouble creating a class instance. The code I’m using works on another server so I’m thinking it must be some settings that are wrong.
The error message I get is: Fatal error: Class 'Test' not found in /mounted-storage/home30a/sub001/sc15979-ERWX/XXXdomainNameXXX/INDEX/test.php on line 6
The class include file seems to get included into the calling file OK. Example code of both the test class and calling page are bellow.
I hope someone can help me out here as it is bound to be some simple setting or something.
Thanks,
Lance
The test code I have:
Class:
<?php
class Test{
public function __construct(){
?>
<script type="text/javascript">alert('test class');</script>
<?php
}
}
?>
Caller:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
include_once('http://www.THEDOMAINNAME/includes/classes-LIT/test.php');
// create class instance
$testx = new Test();
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
</body>
</html>