Re: More include issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2007-06-06 at 13:42 -0400, Dan Shirah wrote:
> Okay, I'm stumped!!!
> 
> I have all of my database connection info in a file: connection.php
> This info is stored in a folder: Connections
> Example of connection.php:
> <?php
> $connection = mssql_pconnect('SERVER','user','password') or die ('server
> connection failed');
> $database = mssql_select_db("my_database", $connection) or die ('DB
> selection failed');
> ?>
> 
> I am trying to include the connection.php file in all of my pages so I don't
> have to hard code the info into every page.
> But, my data never returns because the include apparently is not working.
> If I remove the include and hard code the info, it works.
> 
> Here is an example of the include statement I am using on my pages.
> 
> <?php include '../../Connections/connection.php'; ?>
> 
> The Connections folder is two level above my form page.  Example file
> structure below.
> 
> ROOT
>     Connections
>         connection.php
>     Submit
>         Current_Forms
>              My_Form.php
> 
> I've tried ../../../Connections/connection.php,
> ../../Connections/connection.php, ../Connections/connection.php but nothing
> works.

Yeah, the current path is your document root... so use the following:

<?php include 'Connections/connection.php'; ?>

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux