473,608 Members | 2,565 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to organize includes

I have includes at the top of the file and I have inline includes also
includes in mysql queries. For example:

include './includes/config.inc.php' ;
include $include_path.' dates.inc.php';
include $include_path.' auction_types.i nc.php';
include $include_path.' countries.inc.p hp';
include $include_path.' datacheck.inc.p hp';
include $include_path.' wordfilter.inc. php';
include $include_path.' converter.inc.p hp';
include "header.php ";

$_SESSION["sessionVar s"]=$sessionVars;
include "header.php ";
include phpa_include("t emplate_menu_ph p.html");
include phpa_include("t emplate_sell_pr eview_php.html" );
include "footer.php ";
exit;

}

$query = "SELECT * FROM PHPAUCTIONXL_in vitedbuyersrows WHERE list_id=
$v";
$resi = @mysql_query($q uery);
if(!$resi) {
MySQLError($que ry);
exit;
} else {

while($user = mysql_fetch_arr ay($resi)) {
$query = "SELECT name,email FROM PHPAUCTIONXL_us ers WHERE id='".
$user["buyer_id"]."'";
//print $query."<br />";
$resu = @mysql_query($q uery);
if(!$resu) {
mySQLError($que ry);
exit;
} elseif(mysql_nu m_rows($resu) 0) {

$BUYER_EMAIL = mysql_result($r esu,0,"email");
$BUYER_NAME = mysql_result($r esu,0,"name");
include $include_path." invitation_emai l.inc.php";

}
}
}
}
}

What I want to know is how to organize it? I don't have a
template. Is that what this directory is for:
include './includes/config.inc.php' ;
How do I
know which includes need to be in the directory and which includes
must be in-line?:

Also, I read that require() is better than include(). Should I change
all includes to require?
Thanks,
Jun 2 '08 #1
1 1668
Greetings, JRough.
In reply to Your message dated Tuesday, May 13, 2008, 01:31:49,
$_SESSION["sessionVar s"]=$sessionVars;
Interesting code.
include "header.php ";
And You're including header.php twice.
Do you know what You doing?
What I want to know is how to organize it?
You are free to use any way You prefer. It's obvious.
General recommendation is to have included code stored outside of web root.
How do I know which includes need to be in the directory and which includes
must be in-line?:
Me laughing loudly.
Your question meaningless.
You can place included files anywhere if You can access that place from the
PHP at runtime.
Also, I read that require() is better than include(). Should I change
all includes to require?
Word "better" has relative meaning. Define Your needs first.
And I would seriously recommend You to ACTUALLY READ PHP documentation in the
part of include/require explanation.
It is quite clear.
--
Sincerely Yours, AnrDaemon <an*******@free mail.ru>

Jun 2 '08 #2

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

Similar topics

10
11064
by: Bruce W...1 | last post by:
I've been learning about PHP for a couple of weeks. With includes, PHP scripts, and HTML I can see where a large and complex website could easily turn in to a big hairy mess with files all over the place. Are there any adopted standards, recognized recommendations, or best practices on how all the code should be organized? I haven't found any websites that discuss this. Can anyone point me to information on this? If not then what do...
3
2277
by: _andrea | last post by:
I'd like to write a web-application with other people. It is the first time I write code together other person. I'd like to ask you some advices: 1)have an advice? 2)wich program to use for VCS (for windows)? 3)how to organize the work? Thank you in advance, Andrea.
8
2431
by: Andy | last post by:
Hi, all I am trying to design a parser for C program using C++. Currently what I did for syntax tree is to design a class for each nontermials in the grammar, and use inherentance to link them. For example, as for the expression part, the classes are something like the follows: ..... class MultiplicativeExpr : public AdditiveExpr {
10
9908
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I want to obtain is not possible, but I would like the advice of more experienced python programmers. I am writing a relatively complex program in python that has now around 40 files.
1
1928
by: Rudderius | last post by:
Hey, I'm working on a winform app in VS 2005. I'm wondering if someone knows some best practices on how to organize the toolstrips. I have a menuToolStrip and some other toolstrips. As in many apps, the functionality of the toolstrip en the menubar overlap. (e.g. cut & copy etc) The commands I'm using for my application are more complex off course than just a copy and a paste.
1
1122
by: ASP Developer | last post by:
I have a user control with exposed properties. I have about 100 properties. I would like to organize them so they are easier for other programmers to peruse. Is it possible to organize the misc section and add +/- sections to make it easier to read?
1
1888
by: Thomas Wittek | last post by:
Hi! Is there any possibility/tool to automatically organize the imports at the beginning of a module? I don't mean automatic imports like autoimp does as I like seeing where my objects/functions really come from. For the same reason I don't like "from foo import *". The downside is that you have a rather verbose import section at the
0
1165
by: JRough | last post by:
I have this at the top of the file 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';
6
1465
by: JRough | last post by:
I hate to ask an obvious question but I'm trying not to mess up anything worse than it is already. I have all these variables in- line. Can I do an include and take them off the file into an included file? $with_reserve = $sessionVars; $reserve_price = $sessionVars; $minimum_bid = $sessionVars; $pict_url=$sessionVars; $imgtype = $sessionVars;
0
8057
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
6813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6010
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3959
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2472
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1580
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.