473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to do an include

I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.

To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.

include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';

thanks,
Jun 2 '08 #1
8 1235
JRough wrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.

To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.

include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';

thanks,
Ni, the "inc" is just part of the name. People use it as a sort of
indicator that this particular php file (it ends in .php) is for
inclusion somewhere. It does not mean anything else (but it is a good
practice.)

You probably have $include_path defined in config.inc.php, otherwise it
has to define somewhere. So, if this is the case, so long as you put
functions.inc.php in the same directory as the other includes, then you
are fine.
Jun 2 '08 #2
Greetings, JRough.
In reply to Your message dated Sunday, May 11, 2008, 00:44:41,
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.
To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.
include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';
You said that You have Your code in functions.php, but You're including functions.inc.php

Correct Your code to match Your words and see if it works.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jun 2 '08 #3
On 10 May, 21:44, JRough <jlro...@yahoo.comwrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.

To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.

include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';

thanks,
You could do with learning the basics of how computers work and about
file names and directories. In general, the portion after the last /
(or \ on some systems) is called the "file name". The rest of it is
called the "path". The path consists of the directories and sometimes
the media (or disk) name (e.g. c: on a windoze system).

Also, you terminology is a bit off. A "page" is what a user sees on
their browser. Many php files may be loaded and executed, without
producing a single bit of output to the page. You certainly don't have
any "functions" on your page. You have functions in "files".

Hope this helps.
Jun 2 '08 #4
tnx, :-)
On May 10, 2:55 pm, sheldonlg <sheldonlgwrote:
JRough wrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.
To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.
include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';
thanks,

Ni, the "inc" is just part of the name. People use it as a sort of
indicator that this particular php file (it ends in .php) is for
inclusion somewhere. It does not mean anything else (but it is a good
practice.)

You probably have $include_path defined in config.inc.php, otherwise it
has to define somewhere. So, if this is the case, so long as you put
functions.inc.php in the same directory as the other includes, then you
are fine.
Jun 2 '08 #5
P.S. do I call the functions "file" :-)
functions.inc.php ?
I thought the "." was for somehting like a .inc directory
but if the functions "file" is called functions.inc.php then okay I'll
put it in the same
directory as the other includes.
I didn't know what the "." was for
tnx,

On May 10, 1:44 pm, JRough <jlro...@yahoo.comwrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.

To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.

include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';

thanks,
Jun 2 '08 #6
On 13 May, 02:23, JRough <jlro...@yahoo.comwrote:
P.S. do I call the functions "file" :-)
functions.inc.php ?
I thought the "." was for somehting like a .inc directory
but if the functions "file" is called functions.inc.php then okay I'll
put it in the same
directory as the other includes.
I didn't know what the "." was for
tnx,

On May 10, 1:44 pm, JRough <jlro...@yahoo.comwrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.
To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.
include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';
thanks,
Please do not top post
Jun 2 '08 #7
On May 13, 2:15 am, Captain Paralytic <paul_laut...@yahoo.comwrote:
On 13 May, 02:23, JRough <jlro...@yahoo.comwrote:
P.S. do I call the functions "file" :-)
functions.inc.php ?
I thought the "." was for somehting like a .inc directory
but if the functions "file" is called functions.inc.php then okay I'll
put it in the same
directory as the other includes.
I didn't know what the "." was for
tnx,
On May 10, 1:44 pm, JRough <jlro...@yahoo.comwrote:
I want to organize my code. I have some in-line functions on a
page. I take them all out and put them all on one page called
functions.php.
To call the page I put the include at the top of the page along with
the other includes?
I'm not sure but I guess that the .inc. is a directory? So my
functions are the last include. I am assuming this is right.
include './includes/config.inc.php';
include $include_path.'dates.inc.php';
include $include_path.'auction_types.inc.php';
include $include_path.'countries.inc.php';
include $include_path.'datacheck.inc.php';
include $include_path.'wordfilter.inc.php';
include $include_path.'converter.inc.php';
include $include_path.'functions.inc.php';
thanks,

Please do not top post
Okay, I thought someone told me to do it like that.
Jun 2 '08 #8
On Tue, 13 May 2008 07:49:45 -0700, JRough sez:
Okay, I thought someone told me to do it like that.
Ask three people the best way to carry on a printed conversation, and
you'll get six conflicting answers, along with death threats if you don't
do it the way each advocate demands.

I think the best way is to intermingle relevant portions of the quoted
material with your responses (if you had made another separate point to
which I had a response, I would mark that off with some kind of quote
indicator below this, and reply to that point underneath the quoted
section. The important thing is to minimize your quoted material - strip
away the ten miles of headers, three-level-deep repeated quotes from
earlier discussions, etc. and only quote the portion to which you need to
respond.

But I stopped letting it bother me about 20 years ago when dialup BBSes
and other dinosaurs ruled the earth.

--
Peter B. Steiger
Cheyenne, WY
If you must reply by email, you can reach me by placing zeroes where
you see stars: wypbs.**1 at gmail.com (yes, that's a new address)
** Posted from http://www.teranews.com **
Jun 2 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
60
by: Derrick Coetzee | last post by:
It seems like, in every C source file I've ever seen, there has been a very definite include order, as follows: - include system headers - include application headers - include the header...
9
by: zolli | last post by:
Hi, I've been banging my head against this for a while now. Hoping someone here can shed some light on what's going on. On including stdlib.h in a file, I'm seeing the following errors: ...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
1
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include...
3
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include...
14
by: Jon Rea | last post by:
I am currently cleaning up an application which was origainlly hashed together with speed of coding in mind and therefore contains quite a few "hacky" shortcuts. As part of this "revamping"...
7
by: Giancarlo Bassi | last post by:
Please, what are here the 11 include files (found over the internet)? */mozzarella.c /* #include #include #include #include #include #include
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.