include

PHP define() doesn't seem to be working with include()

I've been trying my hand at OO PHP, and currently have three files. I have a class_lib.php which, at the moment, just has a databaseServer class, an index.php file and a definitions.php file. I want to put all my sensitive database info into the definitions file. However, when I do, I get an error when trying to connect to the database: ...

php, simulate include? Cache system

I'm trying to create a small template system and have a function that loops over an array of items. Currently I'm using the output buffering functions and include so i can load up the template file while it has scope to the class. function loadTemplate($name, $vars) { $buf = ''; $path = $name . '.html'; if (file_exists($path...

Managing include directories in Eclipse CDT

I am using Eclipse CDT (Helios release, CDT 7.0) with a C++ Makefile project. As I am new to Eclipse, I am wondering about how to manage include directories correctly. I'm #including without any paths usually, so I am used to adding my subdirectories (not so many) to the project setting's include directories. I am somewhat confused beca...

Can't compile C++ in Ubuntu using GCC -- Include/Library Problems (collect2: ld returned 1 exit status)

I guess I'm not linking something right? I want to call ABC.cpp which needs XYZ.h and XYZ.cpp. All are in my current directory and I've tried #include <XYZ.h> as well as#include "XYZ.h". Running $ g++ -I. -l. ABC.cpp at the Ubuntu 10 Terminal gives me: `/tmp/ccCneYzI.o: In function `ABC(double, double, unsigned long)': ABC.cpp:(.text...

Need help getting this auto-download header to show the right path

Hi folks, I have a page with mp3s that are playable from a player, and there are also links to download the songs. When the user clicks on the download link, it needs to open the download dialog instead of opening a media player, so it was recommended to me to use this header script: includes/auto-download.php: <?php $path = $_GET['pa...

Include/Require HTTP Address

I'm in need to include a PHP file that I can only reach with a complete HTTP address. I'm confused about this topic, I've heard it's a bad practice. How can I solve that? ...

PHPUnit inclusion path issues

This one's got me stumped. I've been working with PHPUnit for a couple of months now, so I'm not that green...but I look forward to being pointed in the direction of the obvious mistake I'm making! The initialisation process outlined below works fine if I run the "app" from a browser - but PHPUnit is choking...can any one put me out of m...

Pass variable to string in include file - PHP

What I am trying to do is to have an include file with generalized language in a string that will be used across multiple pages, but I also need to pass a variable to the string from the current page. Here is an example: Here is a snippet of the index.php page: <?PHP require_once($_SERVER['DOCUMENT_ROOT'].'/lib/prefix.php'); echo $GE...

subversion include directory exclude files

I want to include a directory when I do my imports but exclude any files that might be in it. how can this be done? ie: include cache dir, but exclude all the cache files in it. in my global-ignores I have tried cache and cache/*, the former just excluded the entire cache dir - expected. and the later included everything. am I clos...

Include problems

Hello, I have to work with a big project with a lot of files in Eclipse Helios CDT. The structur of the project is like following: src -> common (linked folder) -> dbHandler --> folder1 ---> ... --> folder2 ---> ... In folder1 is a h-file which can't find the h-file from the folder ahead. I think it is stupid to include all folders o...

What does this Perl code do?

In cPanel, they tell you to insert this code into the beginning of Perl files. I'm not sure what it does. I've tried code with and without this in the beginning of the file and it seems to all work the same. I haven't tested that out with cron running the code, but only as myself. By "tested it out", I mean using print lines, databas...

EF4/Linq Eager Loading with Include fails to populate all results

Hi, I'm trying out EF4 as part of a .Net 4.0 WCF service. The aim of the service is to return document data as an array of entity objects to any of our ASP.Net apps. The apps are still in .Net 2.0. Due to the nature of the solution I've disabled LazyLoading at context level. I started with this: var revQuery = from revs in context.t...

I have PHP code that needs to be referenced in every single shtml page, is the below possible?

Hey everyone... I'm not too familiar with PHP... but I have PHP code that basically "includes" a file if a condition exists. This PHP code is going to be pretty lengthy and I was wondering if it was possible to create a .php file, and just INCLUDE THAT in my shtml files? What the below is doing is placing the correct navigation bar in ...

Finding Include Files

The current site that I'm working on cleaning up has around 2,000 pages. It's a mess and the old designer used hundreds of include files to ensure that certain bits of content are consistent throughout the entire site. Now that we're moving this content from all these old HTML pages to Drupal I'd like to somehow get a list of these incl...

Using too many PHP includes a bad idea?

My question is whether or not using multiple PHP includes() is a bad idea. The only reason I'm asking is because I always hear having too many stylesheets or scripts on a site creates more HTTP requests and slows page loading. I was wondering the same about PHP. ...

INSERT / INCLUDE Text file content inside HTML page.

Hello Everyone!!! I've got kinda MLM site to make, Like be a member buy purchasing any product of company and create other members under you, in your downline and for that you get commission in product they buy. This is the concept. But, that company is providing a website as its Product. Now, That product is a Website, Where From 100 r...

php include problem with urls with options ?view=task&others file not found.

I really have read the other articles that cover this subject. But I seem to be in a slightly different position. I'm not using modrewrite (other articles). I would like to 'include' a webpage its a 'Joomla php' generated page inside a php script. I'd hoped to make additions on the 'fly' without altering the original script. So I was go...

C++ Specify Headers Include Directory in Code

Is there a way to specify include directories in the code, perhaps via a #pragma? I have my project setup as "src/" and "include/" folders. I am trying to compile in Visual Studio 2010, but I don't want to set it up in the project settings. Is there another way to allow it to compile instead of having to specify the include as #includ...

Unexpected output on file include

I've been working on a custom CMS in PHP and haven't run into any problems until recently. When testing, I've noticed that the string  has started appearing at the top of only the index page. Testing with some die statements throughout the code, it seems the output is coming between a file include. File A <?php if (!defined('IN_CM...

How can I make a regular variable accessible in files included by a class method?

I have a php site which flows as shown below. Please note I'm leaving out most of the code (wherever theres an ellipses). index.php include template.php ... $_template = new template; $_template->load(); ... template.php class pal_template { ... public function load() { ... include example.php; ... } example.php ... global ...