On Friday 02 July 2004 09:16 am, Jordi Canals wrote:
> Andre Dubuc wrote:
> > I thought a simple re-direct page might do
> > the trick.
> >
> > I've tried three methods:
> >
> > the header approach
> > header("location: ../conn-up.php");
> >
> > an absolute header:
> > header("location: /vhome/conn-up.php");
> >
> > and an include approach:
> > include("../conn-up.php");
>
> Te header methods will not work. You need to access directly the
> filesystem in order to include a file. Cannot do it by URL.
>
> The third aproach perhaps could work, not sure. But I would test to
> things (I assume conn.php is on your site root) :
>
> 1. Check the user running the web server hsa permisions to read on the
> directory the file is located.
>
> 2. Try an absolute path to the file. Perhaps it will not permit
> portability, but for test purposes could help.
>
> On conn.php you could try:
>       include("/vhome/conn-up.php");
>
> If it does not work, problably is a permissions problem.
>
> 3. For portability, and when you have been able to include the file as
> said in point 2. You could do in conn.php something like:
>
> $conn_dir = dirname(dirname(__FILE__)); // Gives parent dir
> include($conn_dir . 'conn-up.php');
>
> 4. Could set the path to de directory including the file with
> set_include_path(); and then include just by name:
>
>       $mypath = get_include_path() . PATH_SEPARATOR . "/vhome";
>       set_include_path($mypath);
>
> Hope this can help to investigate a bit more on your problem.
>
> Regards,
> Jordi



Hi Jordi,

Thanks for the advice! I tried

        include("/vhome/conn-up.php");

works like a charm! Funny I never thought of giving the absolute path for the 
include . . . sigh!

Regards,
Andre

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

Reply via email to