Re: include, relative path
- From: No_One <no_one@xxxxxxxxxxxx>
- Date: Wed, 30 Apr 2008 08:29:49 -0500
On 2008-04-30, ^AndreA^ <andrea.bola@xxxxxxxxx> wrote:
Hi everybody,
I'm having a stupid problem with the include command.
I looked around and I found some solutions but, I don't know why, they
don't work at all.
Briefly, this is the structure of my website:
mysite/libraries/db_details.php
mysite/registration/check.php
I need to connect to the database from the script "check.php", and the
details of the database are in "db_details.php", of course... ;-)
so, I have to include "db_details.php" from "check.php" script...
I'm under linux and I've tried so many different solutions without
success, maybe because of the PHP version (5.2.3)... and some
solutions I found were a bit old (2002, 2003) and so I thougth they
could not to work any more.
Here some of them,
ini_set("include_path",".:/libraries");
set_include_path('mysite/libraries/');
include('/..//libraries/db_details.php');
include("../registration/db_details.php");
include "db_details.php";
I'm fed up with that...
any help would very appreciated!!!
Thanks in advance
PS: I don't want to change php.ini settings because I couldn't do it
on my hosting server...
did you try
include ("/mysite/libraries/db_details.php");
if using Linux, get the full path by going to the commandline and
echo $PATH
/home/mywebsite/myhtml etc etc.
Don't forget the first forward slash.
ken
.
- Follow-Ups:
- Re: include, relative path
- From: No_One
- Re: include, relative path
- References:
- include, relative path
- From: ^AndreA^
- include, relative path
- Prev by Date: Re: I've been hacked, help!
- Next by Date: Re: include, relative path
- Previous by thread: Re: include, relative path
- Next by thread: Re: include, relative path
- Index(es):
Relevant Pages
|