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: ...
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...
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...
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...
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...
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?
...
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...
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...
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...
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...
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...
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...
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 ...
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...
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.
...
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...
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...
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...
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...
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 ...