where to put includes

This is a discussion on where to put includes within the PHP Language forums, part of the PHP Programming Forums category; I have this at the top of the file include './includes/config.inc.php'; include $include_path.'dates.inc.php'; include $...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-12-2008
JRough
 
Posts: n/a
Default where to put includes

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';

I have some other includes inline with mysql queries:

include "header.php";

$_SESSION["sessionVars"]=$sessionVars;
include "header.php";
include phpa_include("template_menu_php.html");
include phpa_include("template_sell_preview_php.html");
include "footer.php";
exit;
}


$query = "SELECT * FROM PHPAUCTIONXL_invitedbuyersrows WHERE list_id=
$v";
$resi = @mysql_query($query);
if(!$resi) {
MySQLError($query);
exit;
} else {
while($user = mysql_fetch_array($resi)) {
$query = "SELECT name,email FROM PHPAUCTIONXL_users WHERE id='".
$user["buyer_id"]."'";
//print $query."<br />";
$resu = @mysql_query($query);
if(!$resu) {
mySQLError($query);
exit;
} elseif(mysql_num_rows($resu) > 0) {
$BUYER_EMAIL = mysql_result($resu,0,"email");
$BUYER_NAME = mysql_result($resu,0,"name");
include $include_path."invitation_email.inc.php";
}
}
}
}
}

What I want to know is how to organize it. I don't have a template
and I don't know what one is. How can I take all the includes out and
put it on one page? Is that what this directory is for. How can you
know which includes need to be in the directory and which includes
must be in-line?:


include './includes/config.inc.php';

Thanks,
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0