aimelise Posted March 17, 2006 Posted March 17, 2006 Hello- I'm working on this site: http://souari.forest.net/~cableman/catalog/ and I'd like to create a subdirectory for my news articles at: http://souari.forest.net/~cableman/catalog/news Example: http://souari.forest.net/~cableman/catalog/news/article1.php Problem now is the way all the includes are referenced in /includes/application_top.php Instead of referencing the includes directory for items like my header, footer and nav with something like: <?php require(DIR_WS_INCLUDES . 'header.php'); ?> I decided to use this: <?php require(DIR_WS_HTTP_CATALOG . '/includes/header.php'); ?> DIR_WS_HTTP_CATALOG is defined in /includes/configure.php as this: define('DIR_WS_HTTP_CATALOG', '/~cableman/catalog/'); Error checking is turned off on this shared hosting server and there's nothin in can do about that? Can anyone help me so I'm not throwing all my static, necessary files in the root of the site at /catalog? Thanks to anyone who might read this and reply. .aim The full code for an example news page I wanna post at http://souari.forest.net/~cableman/catalog/news/article1.php is below: <?php require(DIR_WS_HTTP_CATALOG . '/includes/application_top.php'); require(DIR_WS_HTTP_CATALOG . '/includes/' . $language . '/' . FILENAME_NEWS); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_NEWS)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="../stylesheet.css"> </head> <body> <!-- header //--> <?php require(DIR_WS_HTTP_CATALOG . '/includes/header.php'); ?> <!-- header_eof //--> <!-- body //--> <table width="765" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175" bgcolor="#FFFFFF" style="background-image:url(images/cable_layout/cat_nav_backg.gif); background-repeat: repeat-x; padding-right: 5px;" rowspan="3"> <!-- left nav elements --> <?php require(DIR_WS_HTTP_CATALOG . '/includes/column_left.php'); ?> <!-- end left nav elements --> </td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF"> <!-- content area --> <!-- ******************************************************************************** ********** --> <!-- login --> <?php require(DIR_WS_HTTP_CATALOG . '/includes/login.php'); ?> <!-- end login --> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/cable_layout/main_news.jpg" width="590" height="145" alt="News"> <?php //echo $breadcrumb->trail(' - '); ?><br><br> </td> </tr> </table></td> </tr> <tr> <td><?php //echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <!-- news item --> <h4>CMB Awarded with Keeping America Strong Award.</h4> <em>For Immediate Release </em> <strong><br> CMB awarded with "Keeping America Strong" Award</strong> <p>HUNTINGTON BEACH, .CA, February 25, 2004 / PRNewswire / Cable Manufacturing Business, Inc has recognizes by Rear Admiral Kevin F. Delaney U.S. Navy (ret), the U.S. Navy's Southeast regional commander and commander of the Jacksonville Naval Base complex of more than 34 years of active service. Cable Manufacturing Business, Inc is awarded the prestigious "Keeping America Strong" award for its work with the Federal Government for the war on terrorism and operation enduring freedom.</p> <p>Click here for entire article.</p> <!-- end news item --> <div class="line"></div> <!-- news item --> <h4>CMB Delivers USB Technology to the Marketplace.</h4> <em>For Immediate Release<br> </em><strong>CMB Introduces Its New USB PCI Card</strong> <p>Huntington Beach, CA - October 11, 2000. CMB, respected and well-know manufacturer of Universal Serial Bus (USB) connectivity products today introduced its new USB PCI Card (SUSBAAPCI). Designed to offer the best of connectivity PC users, the CMB-s USB PCI Card adds two 12 Mbps USB ports to the user-s computer.</p> <p>Click here for entire article.</p> <!-- end news item --> </td> </tr> </table></td> </tr> </table></td> <!-- ******************************************************************************** ********** --> <!-- end content area --> </td> </tr> </table> <br> <!-- footer //--> <?php require(DIR_WS_HTTP_CATALOG . '/includes/footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_HTTP_CATALOG . '/includes/application_bottom.php'); ?>
Guest Posted March 17, 2006 Posted March 17, 2006 Problem from the start is you are using require(DIR_WS_HTTP_CATALOG . '/includes/application_top.php'); in a file which doesnt yet know what DIR_WS_HTTP_CATALOG means - it has no way of having defined this yet! Easiest way of doing this would be to use relative links: require('../includes/application_top.php'); which sends the link up a directory to catalog, then back to includes. Should sort out your error problems.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.