Can anyone tell me why this happen?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aetoc
Forum Commoner
Posts: 37
Joined: Tue Jan 31, 2006 2:48 am

Can anyone tell me why this happen?

Post by aetoc »

I have this code in a page.

Code: Select all

 
$spaw_root = $_SERVER['DOCUMENT_ROOT'].'/new/administration/html_editor/';
 
echo $spaw_root;
include ($spaw_root.'config/spaw_control.config.php');
include ($spaw_root.'class/toolbars.class.php');
include ($spaw_root.'class/lang.class.php');
 
When I run the page I get this message.

/home/procell/procell-www/new/administration/html_editor/
Warning: main(/home/procell/procell-www/administration/html_editor/class/toolbars.class.php) [function.main]: failed to open stream: No such file or directory in /home3/procell/procell-www/new/administration/html_editor/spaw_control.class.php on line 19

If you see, the echo is correct but in the include the /new dosn't appear.

Can anyone help me? :banghead:

Thanks in advance.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Can anyone tell me why this happen?

Post by onion2k »

spaw_control.class.php is trying to include a file but it's using the wrong path.
aetoc
Forum Commoner
Posts: 37
Joined: Tue Jan 31, 2006 2:48 am

Re: Can anyone tell me why this happen?

Post by aetoc »

Yes I know that but the $spaw_root is the correct path.

What I can't understand is why when I echo the var its right and when I use it in the include is wrong.

The echo displays this: /home/procell/procell-www/new/administration/html_editor/

but the include displays this: /home/procell/procell-www/administration/html_editor/

* look at the /new/
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Can anyone tell me why this happen?

Post by onion2k »

What does line 19 of spaw_control.class.php say?
aetoc
Forum Commoner
Posts: 37
Joined: Tue Jan 31, 2006 2:48 am

Re: Can anyone tell me why this happen?

Post by aetoc »

is the line 5 of the code that I have post.

The massage repeats for the line 6 and 7 of the code.
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Re: Can anyone tell me why this happen?

Post by panic! »

klortho wrote:The error message is the Truth. The error message is God
Post Reply