Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Including a config.php file
Old 11-15-2007, 06:39 PM Including a config.php file
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
I have a file called config.php with the contents of:
PHP Code:
$dbloc="localhost";
$dbname="*****_wiki";
$dbuser="*****_wiki";
$dbpass="wiki";
$dbprefix="wiki_";
$sitename="test";
$sitepass="test";
$siturl="test";
# END CONFIG # 
and then i put this in another php file
PHP Code:
include 'include/installconfig.php'
and it prints the contents of the file, it is supposed to just use those variables in the script im including it in. thanks
melefire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-15-2007, 06:42 PM Re: Including a config.php file
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
do you have php script delimiters around the code in the include ?
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-15-2007, 06:45 PM Re: Including a config.php file
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
no, if you mean <?php and ?>
melefire is offline
Reply With Quote
View Public Profile
 
Old 11-15-2007, 07:07 PM Re: Including a config.php file
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I do ..
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-15-2007, 07:49 PM Re: Including a config.php file
Defies a Status

Posts: 1,606
Trades: 0
And unless I mis-read what you wrote it would be:

Quote:
<?php include ("/config.php"); ?>
and the / might not be required.
__________________
Colbyt

Please login or register to view this content. Registration is FREE
colbyt is offline
Reply With Quote
View Public Profile
 
Old 11-15-2007, 08:06 PM Re: Including a config.php file
melefire's Avatar
Experienced Talker

Posts: 46
Name: matt
Trades: 0
thanks
melefire is offline
Reply With Quote
View Public Profile
 
Old 11-16-2007, 12:15 PM Re: Including a config.php file
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Change the code to:

PHP Code:
<?php
$dbloc
="localhost";
$dbname="*****_wiki";
$dbuser="*****_wiki";
$dbpass="wiki";
$dbprefix="wiki_";
$sitename="test";
$sitepass="test";
$siturl="test";
# END CONFIG #
?>
PHP Code:
<?php
include 'include/installconfig.php';
?>
I best also point out, it's a good idea to * out the password as well hehe.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE

Last edited by rogem002; 11-16-2007 at 12:22 PM..
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 11-16-2007, 06:17 PM Re: Including a config.php file
Average Talker

Posts: 23
Trades: 0
i also add those on my projects... it makes your project easy to update and manage
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
mountlaurel is offline
Reply With Quote
View Public Profile Visit mountlaurel's homepage!
 
Reply     « Reply to Including a config.php file
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26749 seconds with 12 queries