Snarf? Posted April 9, 2008 Posted April 9, 2008 This seems like it should be easy to do but I don't know enough php to get it right. I want to add an oscommerce infobox to a php page that includes html but i keep getting the error message: Warning: include(DIR_WS_BOXEScategories.php) [function.include]: failed to open stream: No such file or directory in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 83 Warning: include() [function.include]: Failed opening 'DIR_WS_BOXEScategories.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.4/lib/php') in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 83 Warning: require(DIR_WS_BOXESservices.php) [function.require]: failed to open stream: No such file or directory in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 93 Fatal error: require() [function.require]: Failed opening required 'DIR_WS_BOXESservices.php' (include_path='.:/usr/local/lib/php-5.2.4/lib/php') in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 93 The code I'm putting into the html page is : <?php /* $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { //include(DIR_WS_BOXES . 'manufacturers.php'); } //require(DIR_WS_BOXES . 'whats_new.php'); require(DIR_WS_BOXES . 'services.php'); //require(DIR_WS_BOXES . 'search.php'); //require(DIR_WS_BOXES . 'information.php'); ?> I know this can be done. If you can help me I will pass you the goblet of awesome and we will toast the gods together!
photofxplus Posted April 9, 2008 Posted April 9, 2008 Warning: include(DIR_WS_BOXEScategories.php) The error above describes the file path as 'DIR_WS_BOXEScategories.php'. 'DIR_WS_BOXES' should show as something like 'includes/boxes/' in the error if it is being defined. Since this is not so then the variable 'DIR_WS_BOXES' is not being defined. The page application_top.php includes all the variables for this to happen. application_top.php Line:28 require('includes/configure.php'); Make sure you are either adding this page (application_top.php or includes/configure.php) prior to including the file path: include(DIR_WS_BOXES . 'categories.php'); Or rewrite the file path and exclude 'DIR_WS_BOXES'. Such as: include('includes/boxes/categories.php'); Lloyd
♥FWR Media Posted April 9, 2008 Posted April 9, 2008 This seems like it should be easy to do but I don't know enough php to get it right.I want to add an oscommerce infobox to a php page that includes html but i keep getting the error message: Warning: include(DIR_WS_BOXEScategories.php) [function.include]: failed to open stream: No such file or directory in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 83 Warning: include() [function.include]: Failed opening 'DIR_WS_BOXEScategories.php' for inclusion (include_path='.:/usr/local/lib/php-5.2.4/lib/php') in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 83 Warning: require(DIR_WS_BOXESservices.php) [function.require]: failed to open stream: No such file or directory in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 93 Fatal error: require() [function.require]: Failed opening required 'DIR_WS_BOXESservices.php' (include_path='.:/usr/local/lib/php-5.2.4/lib/php') in /hermes/bosweb/web249/b2497/sl./public_html/HTML_AND_PHP.php on line 93 The code I'm putting into the html page is : <?php /* $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include(DIR_WS_BOXES . 'categories.php'); } if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { //include(DIR_WS_BOXES . 'manufacturers.php'); } //require(DIR_WS_BOXES . 'whats_new.php'); require(DIR_WS_BOXES . 'services.php'); //require(DIR_WS_BOXES . 'search.php'); //require(DIR_WS_BOXES . 'information.php'); ?> I know this can be done. If you can help me I will pass you the goblet of awesome and we will toast the gods together! DIR_WS_BOXES should be defined in .. catalog/includes/configure.php as .. define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); The very fact that you are seeing it as a string DIR_WS_BOXES means that it isn't. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 DIR_WS_BOXES should be defined in .. catalog/includes/configure.php as .. define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); The very fact that you are seeing it as a string DIR_WS_BOXES means that it isn't. It looks properly defined to me: define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); Does the page that I'm adding the infobox too need to be in a particular folder? For example if I'm adding the categories infobox to newpage.php does newpage.php need to be somewhere in particular for the infobox to work?
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 Can you explain what you mean by the underlined statement? I'm dumb. The error above describes the file path as 'DIR_WS_BOXEScategories.php'. 'DIR_WS_BOXES' should show as something like 'includes/boxes/' in the error if it is being defined. Since this is not so then the variable 'DIR_WS_BOXES' is not being defined. The page application_top.php includes all the variables for this to happen. application_top.php Line:28 require('includes/configure.php'); Make sure you are either adding this page (application_top.php or includes/configure.php) prior to including the file path: include(DIR_WS_BOXES . 'categories.php'); I've changed the code a little bit: if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include('includes/boxes/categories.php'); } if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { //include(DIR_WS_BOXES . 'manufacturers.php'); } //require(DIR_WS_BOXES . 'whats_new.php'); include('includes/boxes/services.php'); //require(DIR_WS_BOXES . 'search.php'); //require(DIR_WS_BOXES . 'information.php'); ?> Thanks for the replies. If it wasn't for this forum oscommerce would be the most hated software ever. Help me unlock its secret wonders!!
photofxplus Posted April 9, 2008 Posted April 9, 2008 It looks properly defined to me: Does the page that I'm adding the infobox too need to be in a particular folder? For example if I'm adding the categories infobox to newpage.php does newpage.php need to be somewhere in particular for the infobox to work? It is properly defined on that page 'catalog/includes/configure.php' but what we are saying is that the variable is not being defined by the page you are using the variable on. The variable is 'DIR_WS_BOXES', the page you are trying to use it on is 'HTML_AND_PHP.php'. I do not know exactly what you are trying to do so I do not know where you should put the page. It looks like a page that should go in the directory 'includes\boxes'. Try placing the statement: require ('includes/configure.php'). See what happens. Note: You may need to edit the file path 'includes/configure.php' from the page 'HTML_AND_PHP.php' to the file 'configure.php'. It should be relative. I do not know where your page 'HTML_AND_PHP.php' is.. Where is it? Lloyd
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 It is properly defined on that page 'catalog/includes/configure.php' but what we are saying is that the variable is not being defined by the page you are using the variable on.The variable is 'DIR_WS_BOXES', the page you are trying to use it on is 'HTML_AND_PHP.php'. I do not know exactly what you are trying to do so I do not know where you should put the page. It looks like a page that should go in the directory 'includes\boxes'. Try placing the statement: require ('includes/configure.php'). See what happens. Note: You may need to edit the file path 'includes/configure.php' from the page 'HTML_AND_PHP.php' to the file 'configure.php'. It should be relative. I do not know where your page 'HTML_AND_PHP.php' is.. Where is it? When I put require ('includes/configure.php') in it gives me a fatal error, but after moving the page to the 'catalog' folder I get: Fatal error: Class 'infoBoxHeading' not found in /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/includes/boxes/categories.php on line 68
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 I do not know exactly what you are trying to do so I do not know where you should put the page. It looks like a page that should go in the directory 'includes\boxes'. I have a page I wrote in html like this one here: http://www.alltarotproducts.com What I want to do is put the category infobox in the left-column where it currently says "hundreds of items".
♥FWR Media Posted April 9, 2008 Posted April 9, 2008 If DIR_WS_BOXES is correct in configure.php and yet is showing as a string "DIR_WS_BOXES" in your PHP file then it's quite simple you are calling a seperate file outside of oscommerce. If you want to create a new PHP file and you want that PHP file to "inherit" the oscommerce variables then it has to have at the top. <?php require('includes/application_top.php'); Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 If DIR_WS_BOXES is correct in configure.php and yet is showing as a string "DIR_WS_BOXES" in your PHP file then it's quite simple you are calling a seperate file outside of oscommerce. If you want to create a new PHP file and you want that PHP file to "inherit" the oscommerce variables then it has to have at the top. <?php require('includes/application_top.php'); ok now we are getting somewhere. I'm getting a new error message though: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/HTML_AND_PHP.php:6) in /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/includes/functions/sessions.php on line 97 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/HTML_AND_PHP.php:6) in /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/includes/functions/sessions.php on line 97 This is the craptastic page I'm working on http://www.alltarotproducts.com/store/HTML_AND_PHP.php
photofxplus Posted April 9, 2008 Posted April 9, 2008 This page is the column left page. It should have already called the page application_top with the index page??. Lloyd
♥FWR Media Posted April 9, 2008 Posted April 9, 2008 ok now we are getting somewhere. I'm getting a new error message though: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/HTML_AND_PHP.php:6) in /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/includes/functions/sessions.php on line 97 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/HTML_AND_PHP.php:6) in /hermes/bosweb/web249/b2497/sl.bakerjosh1979/alltarotproducts.com-redirect/store/includes/functions/sessions.php on line 97 This is the craptastic page I'm working on http://www.alltarotproducts.com/store/HTML_AND_PHP.php <edit>Your HTML_AND_PHP.php is outputting before session start</edit> Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 I'm assuming I have to edit application_top.php now? (ignore this post)
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 ok i'm looking at line 97 of the page itself (not application_top.php) and session isn't in there anywhere. This is the entire string of php code that extends beyond line 97. /* $Id: column_left.php,v 1.15 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_categories_box(); } else { include('includes/boxes/categories.php'); } if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_manufacturers_box(); } else { //include(DIR_WS_BOXES . 'manufacturers.php'); } //require(DIR_WS_BOXES . 'whats_new.php'); include('includes/boxes/services.php'); //require(DIR_WS_BOXES . 'search.php'); //require(DIR_WS_BOXES . 'information.php'); ?></td> </tr> </table> </td>
photofxplus Posted April 9, 2008 Posted April 9, 2008 Apparently you are writing to the browser prior to calling application top. A session cookie has to be set prior to anything else. No you should not need to edit the application_top page. Is the call for the application_top at the top of the page? Lloyd
♥FWR Media Posted April 9, 2008 Posted April 9, 2008 I'm assuming I have to edit application_top.php now? This is entering the realms of bespoke coding as we are talking about your changes not core osc so I'm leaving it here. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 Apparently you are writing to the browser prior to calling application top. A session cookie has to be set prior to anything else. No you should not need to edit the application_top page. Is the call for the application_top at the top of the page? Yeah its at the top.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 Yeah its at the top. O wait. I am an idiot. By "top of the page" you meant the top and not some other top like the top of the code. Now it is working without any bespoking. Now I need to update the links too my images I guess.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 I'm so happy I'm going to weep :'( thanks. :lol: I hope this thread helps other newbies add infoboxes to their own cool pages in the future.
Snarf? Posted April 9, 2008 Author Posted April 9, 2008 What does bespoking mean? FWR Media said "This is entering the realms of bespoke coding as we are talking about your changes not core osc so I'm leaving it here". I turned it into a verb.
photofxplus Posted April 9, 2008 Posted April 9, 2008 realms of bespoke coding So you dont know what that means either? Lloyd
♥FWR Media Posted April 9, 2008 Posted April 9, 2008 What does bespoking mean? "bespoke" coding means coding to one's particular needs as opposed to being a standard function of oscommerce. This is fine in the realms of publicly available contributions but when it enters one persons particular requirements then it really should not expect to receive support here. It is at the individual discression of posters though and may well receive support if someone feels particulary helpfull. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.