I'm including PHP Class like that
require_once(realpath($_SERVER["DOCUMENT_ROOT"]).'\xampp\htdocs\aclass\classfile.php');
but when i executed the code thow a error
Warning: require_once(C:\xampp\htdocs\xampp\htdocs\aclass\classfile.php): failed to open stream: No such file or directory in C:\xampp\htdocs\aclass\index.php on line 2
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\xampp\htdocs\aclass\classfile.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\aclass\index.php on line 2
fileclass.php
<?php
class Test{
public function hello(){
echo "hello every one";
}
}
testclass.php
<?php
require_once (realpath($_SERVER["DOCUMENT_ROOT"]).'\xampp\htdocs\aclass\classfile.php');
$var=new Test();
$var->hello();
thank you in advance!!
classfile.php
andfileclass.php
:-? – Álvaro González