[PHP] Re: problems with include()

2003-01-30 Thread Al
Looks like you are only backing up 2 levels when you need 3.

Why not try something like:

$root= the absolute path to your root folder;

Then simply:

include ($root . mainfile.php);

etc.


Daniel Negron/Kbe wrote:

I have this code :

?php

if(!isset($mainfile))
{
include(mainfile.php);
}
include(open_session.php);
include('config.php');
include ('header.php');

Coverted html in here.

include ('footer.php');

?

which works great from the root dir where  these files are stored. [all
content is showing properly]

If I move the file to its final destination, let say ...
http://root_dir/intranet/training/final_folder

I change the code to match

?php

if(!isset($mainfile))
{
include(../../mainfile.php);
}
include(../../open_session.php);
include('../../config.php');
include ('../../header.php');

Coverted html in here.

include ('../../footer.php');

?

ALL I get is the Converted HTML printed on the screen.  I have tried many
variations of traversing the directories, but this does not seem to be
working.  Can anyone help ?


Thank you,

**DAN**




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: problems with include()

2001-09-13 Thread LRW

:::hangs head in utter shame:::
Because I'm a complete idiot and saved the bleeding file to a local
directory instead of under the web server's.
I shall now open my shirt for the flogging. =/

Liam


Lrw wrote in message [EMAIL PROTECTED]...
I got a plain test to work...made a test.php that included the following:
htmlheadtitlePHP Test/title/head
body
?php echo Hello Worldp;?
br
?include(texttest.txt);?
br
/body/html

(texttest.txt just has some randome words in it.)

But when I try to make a page with tables, and have it place the text in a
cell, I get the following error:
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Followed by nothing.

The code is:
htmlheadtitleNew Page 1/title/head
body
h1Test/h1
div align=left
  table border=2 cellspacing=1 width=100%
tr
  td width=33%Boo/td
  td width=33%nbsp;/td
  td width=34%nbsp;/td
/tr
tr
  td width=33%nbsp;/td
  td width=33%
  ?php
  include(texttest.txt);
  ?/td
  td width=34%nbsp;/td
/tr
tr
  td width=33%nbsp;/td
  td width=33%nbsp;/td
  td width=34%
p align=rightYa/td
/tr
  /table
/div
/body
/html

Pretty simple and straightforward I would think. I named it tabtest.php.

Any ideas why it'll work in the 1st but not the 2nd example?

Thanks for all your help! =)

Liam





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]