Here’s the folder structure of my project:
/ping --/Controller ----Ping_Conntroller_Main.php ----Ping_Conntroller_Db.php --/Model ----dbCredentials.php --/View ----output.html.php
‘ping’ is the folder that contains my project and it sits inside the ‘xampp/htdocs/’ directory on my computer (C:/xampplite/htdocs/)
Here is the initial code for each file:
OUTPUT.HTML.PHP
---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
include($root.'/ping/Controller/Ping_Controller_Main.php');
PING_CONTROLLER_DB.PHP
----------------------
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
require($root.'/ping/Model/dbCredentials.php');
class Ping_Controller_Db
{
PING_CONTROLLER_MAIN.PHP
------------------------
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
require($root.'/ping/Controller/Ping_Controller_Db.php');
class Ping_Controller_Main
{
These are the errors I get when trying to access the ‘output.html.php’ file in a browser:
Warning: include(C:/xampplite/htdocs/ping/Controller/Ping_Controller_Main.php) [function.include]: failed to open stream: No such file or directory in C:\xampplite\htdocs\ping\View\output.html.php on line 6
Warning: include() [function.include]: Failed opening 'C:/xampplite/htdocs/ping/Controller/Ping_Controller_Main.php' for inclusion (include_path='.;C:\xampplite\php\PEAR') in C:\xampplite\htdocs\ping\View\output.html.php on line 6
I know I must be doing something really stupid, but I’ve been staring at the error for the past 20mins and can’t seem to get this to work.
Thanks in advance!
Filenames contain double “n” (CoNNtroller).