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
problem with "DEFINE"
Old 04-01-2011, 10:22 AM problem with "DEFINE"
Junior Talker

Posts: 2
Trades: 0
I am integrating a file manager to my script but...

The config. file (file manager) is dead simple and its included in several other files:

<?php
define('BASEDIR', 'Q:\path_to folder\username');

?>

The thing is that I want to get the path form a database but I can't as far as it's define and not a normal variable...Is there any way to put a variable instead of that path without changing the "BASERDIR?

appreciate your help.
blackflow is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-01-2011, 09:30 PM Re: problem with "DEFINE"
Super Spam Talker

Posts: 880
Name: Paul W
Trades: 0
Change the code that uses BASEDIR to use the db value instead.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is online now
Reply With Quote
View Public Profile
 
Old 04-02-2011, 03:25 AM Re: problem with "DEFINE"
Shey's Avatar
Keeper of the herd

Posts: 1,598
Name: Shey
Location: Behind you, laying my ever corrupting hands upon your shoulders. Soon, you shall be an extension of me.
Trades: 0
Code:
// Locate config.php and set the basedir path
$folder_level = "";
while (!file_exists($folder_level."config.php")) { $folder_level .= "../"; }
require_once $folder_level."config.php";
define("BASEDIR", $folder_level);
__________________
RenditionDigital provides Software Development, Games Development, Digital Publishing, Social Media moderation in all flavors-
Please login or register to view this content. Registration is FREE
. What is software engineering? There is a great group of highly skilled tech people
Please login or register to view this content. Registration is FREE
. |Also visit My Blog
Please login or register to view this content. Registration is FREE
Shey is offline
Reply With Quote
View Public Profile Visit Shey's homepage!
 
Reply     « Reply to problem with "DEFINE"
 

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.13632 seconds with 12 queries