include

Why am I unable to use a variable in my require or include statement on XAMPP?

While cleaning up some old php scripts I've noticed some weird behavior with require/include statements when I try to use variables. On the live server, the following code works fine.. <?php $test = "http://localhost/elearning/trunk/mypage.php"; require "$test"; ?> ..but on my XAMPP installation ((basic package) version 1.6.7) I rece...

C : Code still runs without any includes (Bloodshed's Dev-C++)

I am currently learning and experimenting with C and am using Bloodshed's DEV-C++ as an IDE. Now, I just realized that the following piece of code (as it is...no includes or nothing) compiles and runs : main () { printf("%d", strlen("hello")); } Now, if I'm not mistaken, shouldn't two header files be included in this source fo...

Which is better performance in PHP?

I generally include 1 functions file into the hader of my site, now this site is pretty high traffic and I just like to make every little thing the best that I can, so my question here is, Is it better to include multiple smaller function type files with just the code that's needed for that page or does it really make no difference to j...

Where are include files stored - Ubuntu Linux, GCC

So, when we do the following: #include <stdio.h> versus #include "myFile.h" the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive. It just utilizes the files with no interaction from me. I think that on my Ubuntu Linux machine the files are stored at /usr/include/. How does...

Do you know tool building tree of include files in project\file?

Say, I'd like to have a tool (or script?) taking project (or .h file) and building searchable tree of "includes" included into it (of included into of included into and so so on). Is there exist something like this? Should I write this by myself [of course I am :), but may be somebody had it already written or may be has an idea how to g...

How does one include TR1?

Different compilers seem to have different ideas about TR1. G++ only seems to accept includes of the type: #include <tr1/unordered_map> #include <tr1/memory> ... While Microsofts compiler only accept: #include <unordered_map> #include <memory> ... As for as I understand TR1, the Microsoft way is the correct one. Is there a way to ...

PHP - include a php file and also send query parameters

Hi I have to show a page from my php script based on certain conditions. I have an if condition and am doing an "include" if the condition is satisfied. if(condition here){ include "myFile.php?id='$someVar'"; } Now the problem is the server has a file "myFile.php" but I want to make a call to this file with an argument (id) and the ...

Manipulating the search path for include files

My development environment is such that I have some_header.h in /usr/include and in /another/directory. /another/directory contains some header files I need to include in my program, but I want to use some_header.h from /usr/include. When I use gcc ... -I/another/directory gcc uses /another/directory/some_header.h. If I use gcc ...

C++ header policy on large projects (redux)

I've read everything I could find on this topic, including a couple of very helpful discussions on this site, the NASA coding guidelines and Google C++ guidelines. I even bought the "physical C++ design" book recommended on here (sorry, forgot the name) and got some useful ideas from that. Most sources seem to agree - header files shou...

To understand PHP's include -command

I would like to have all variables accessible of the file *handler_login.php* which I include in the file *handler_question.php*. The *handler_question.php* processes the data from the following form. My form_question.php <form method="post" action="handler-question.php"> <p>Title: <input name="question_title" type="text" c...

C/C++, can you #include a file into a string literal?

I have a C++ source file and a Python source file. I'd like the C++ source file to be able to use the contents of the Python source file as a big string literal. I could do something like this: char* python_code = " #include "script.py" " But that won't work because there need to be \'s at the end of each line. I could manually copy a...

Joomla include database functions

Hello. I'm using Joomla 1.5. I have created a custom component that pulls data out of the database perfectly. I initialize the database in my main component file like this: $db =& JFactory::getDBO(); The problem is that I have a jQuery autocomplete plugin on my component page that makes calls to a PHP file from my component folder. Th...

Tricky include situation in C

I have a file named cpu.h that includes two other headers named register.h and addrmode.h. A cpu_t struct is defined in cpu.h that the two includes need for their functions. I try to include cpu.h in the two other include files, but nothing is included. I am guessing they are not included because of the include guards set up in cpu.h. Do...

PHP include files with parse errors

I've got an dynamically-generated PHP file that is included (via include) in other PHP script. When the first one (for some obscure reason) is generated with parse-errors, causes the main script parse-error an stop the execution. Is there any way to detect parse errors when including a file so I can regenerate dinamically that file? Th...

Included variables not working in PHP

Alright, so this is something really basic, and I know that when someone tells me the answer I'm going to feel really silly, but I can't for the life of me figure out why the following code isn't working: index.php: <?php include('config.php'); //this works fine. variables in this file are reached correctly - $_MYSQL is defined there ?...

Has groovy an include mechanism?

We are searching for an include mechanism for groovy scripts to have space for cross-cutting-concerns. In my example we have, web service endpoints as groovy scripts and want to log to our web service protocol. for that we use our implicit object (getting from our framework) to create the logging statement. But this is boilerplate code...

Circular C++ Header Includes

In a project I have 2 classes: // mainw.h #include "IFr.h" ... class mainw { public: static IFr ifr; static CSize=100; ... }; // IFr.h #include "mainw.h" ... class IFr { public float[mainw::CSize]; }; But I cannot compile this code, getting an error at the static IFr ifr; line. Is this kind of cross-inclusion prohibited? ...

about compilation error in Visual C++

Error 1 error C2039: 'memchr' : is not a member of '`global namespace'' c:\program files\microsoft visual studio 9.0\vc\include\cstring 19 new project 17 ...

Can I disable #include in ASP.NET?

I have been unable to find anything using the google... If I write on my ASP.NET code page: <!-- #include file="file_to_include.aspx" --> the file is output to the page. How do I disable this behavior? MSDN info on #include and Server Side Include (SSI) ...

XCode include paths

I'm having a problem getting XCode to deal with a particular file structure that I am using or that I wish to use. I have a set of files in the following form... Library Headers Library Package1 Header1.h Header2.h HeaderN.h Package2 Header1.h Hea...