HELP! Include

I’m a newbie to PHP. Trying to get this include statement to work. Says no such file or dir, but the file is in there.

Code at the top of my controller, index.php:

<?php
include $_SERVER[‘DOCUMENT_ROOT’] . ‘/includes/magicquotes.inc.php’;

Warning produced:

[FONT=“Courier New”]Warning: include(C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/includes/magicquotes.inc.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gotextbookstore\index.php on line 2

Warning: include() [function.include]: Failed opening ‘C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/includes/magicquotes.inc.php’ for inclusion (include_path=‘.;C:\php\pear’) in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gotextbookstore\index.php on line 2[/FONT]

It’s immediately obvious to me that you’ve forgotten something. Not looking at the slashes (or their direction) do you see something extra on the end of the second file path?

C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/
C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\gotextbookstore\

DOCUMENT_ROOT supplies the top level of the public directory - htdocs. It won’t supply gotextbookstore - thats why its called the ROOT.

Got it! Thanks so much.