include

How to include a class

I have index.php and I want to include class.twitter.php inside it, how do I do this? Hopefully then when I put the below code in index.php it will work. $t = new twitter(); $t->username = 'user'; $t->password = 'password'; $data = $t->publicTimeline(); ...

Referencing an unmanaged C++ project within another unmanaged C++ project in Visual Studio 2008

First of all, let me say that I am not a C++ developer. However, I am working on a neural network project that requires me to work with C++. I am working with the Flood Neural Network library. I am trying to use a neural network library in an unmanaged C++ project that I am developing. My goal is to create an instance of a class object w...

PHP: Sessions across includes

I am needing to use sessions for my php page, so, on my index.php page, I add session_start(); right after the opening php tag. But, this page has some includes, inside of which have other includes. So, deeper down, when I want to call a $_SESSION var, it is not working. How can I access a session var even deep down into .inc files? ...

Can I expand #include files inline and not expand directives?

I'm trying to simplify the deployment of an application. In order to build the final application on an end-user's machine, a couple of C files need to be compiled. This means that dozens of header files need to be shipped along with the application. I'd like to be able to pre-include the contents of the include files, but I also need ...

Unix permissions, read vs. execute (PHP context)

I have a php script which needs to connect to a database. The credentials for the database are stored in another php script. If I set the permissions for the credentials file to 661 so that Public has execute permission but not read permission, does this allow the main script to access the credentials and connect to the DB while prevent...

Rails: Referring back to model the object belongs to

This is probably a dumb question, but I can't seem to find a good answer. I want to know the best way to refer back to the model that an object belongs to. For example: class User < ActiveRecord::Base has_many :posts end class Post < ActiveRecord::Base belongs_to :users end So, to get the user's posts, I can use user.posts, b...

Saving a .php file and saving the includes too (possibly)

The setup: I have a standard .php file (index.php) that contains two includes, one for header (header.php) and one for footer (footer.php). The index.php file looks like this: index.php <?php include header.php; ?> <h2>Hello</h2> <p class="editable">Lorem ipsum dolar doo dah day</p> <?php include footer.php; ?> header.php like thi...

How can I avoid including class implementation files?

Instead of doing #include "MyClass.cpp" I would like to do #include "MyClass.h" I've read online that not doing so is considered bad practice. ...

Newbie C #include Question

I roughly understand the rules with what #include does with the C preprocessor, but I don't understand it completely. Right now, I have two header files, Move.h and Board.h that both typedef their respective type (Move and Board). In both header files, I need to reference the type defined in the other header file. Right now I have #incl...

Rails lib includes

Hello I have a puzzling issue regarding modules defined in the lib dir I have two files #lib/authentication.rb module Authentication end #lib/test_module.rb module TestModule end In my application controller I have class ApplicationController < ActionController::Base include Authentication include TestModule end ...

JSP equivalent to the PHP include() function?

I just want to include an HTML file server-side into another HTML file, using JSP. PHP is not available. Is this what I want? <jsp:include page="/include.html"></jsp:include> ...

PHP file_get_contents with php intact?

As opposed to using an include, which executes the included php in the file...is it possible to save the contents of a php file to a variable - but with the php still intact and executable? My goal looks something like: $template = some_imaginary_include_function('myfile.php'); foreach($list_of_blogs as $blog) { // somehow get blog...

Maven: Combine web projects

Hi, I have following Maven projects set up: PM-Core PM-Web (with a dependency to PM-Core) Now, this project is used for several clients but for each client there are some small differences: mostly differences in configuration files but some clients also require additional java files (which may not be installed for the other clients)....

Restrictions on PHP include()

Hey guys, I am separating some XHTML from PHP by putting the XHTML into a separate file and then using PHP's include() function within the PHP script. This works perfectly fine, however, users are still able to access the .html file directly if they know the address. They can't really do much with it, but I would rather it not show. ...

php class performance question...what should I do?

I'm building a webapp using php, ajax, javascript, mysql. I've been worring about something for a while, but not sure if it's really a problem or not. Here's the basic concept of how the code is working...I would like to know if I should change it now, or if it is o.k to use as is. Performance is important to me...over 5,000 users sho...

monitoring disc reads

Hi, i want to use apc in php, to avoid disc reads when including files. But how can i know if files are really coming from shared memory, instead of disc reads? Does anyone know how to measure the number of disc reads for a php script, or in a time interval? (on windows server 2003) Thanks a lot in advance, regards, Charles ...

PHP - include PART of a file - how??

i want to have ONE file from which PHP can source content text such as title, marquee and other small updates. i think i remember something like this in asp where you can point asp to a line on a text file and it will pluck it out. help!! thanks. dan ...

PHP Include behaving strangely?

For some reason if i inlcude() a file deeper in the file structure to where the file calling the include() is, it works file, or if i include a file on the same level. If i try to go include('../backFile.php') it tells me there was no file? Any help :( ...

Able to include file in ASP.NET, but not check if it exists.

I want to include certain files in my page. I'm not always sure if they exists, so I have to check if they do. (Otherwise the page crashes, as you probably know) <%@ Page Language="C#" %> <html> <body> <% bool exists; exists = System.IO.File.Exists("/extra/file/test.txt"); %> Test include:<br> <!--#include file="/extra/file/test....

Good ASP.NET method for checking, reading and returning file contents

I found a good way to check if a file exists and read the contents if it does, but for some reason I can't create a method out of it. Here's what I have so far: <script runat="server"> void Page_Load(Object s, EventArgs e) { lblFunction.Text = mwbInclude("test.txt"); } string mwbInclude(string fileName) { ...