Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code in some store pages


dmatwood

Recommended Posts

I am getting this code on some of my store pages. It happened after installing header tags and Seo Url. Heres the code:

 

if (isset($HTTP_GET_VARS['manufacturers_id'])) $db_query = tep_db_query("select manufacturers_htc_title_tag as htc_title, manufacturers_htc_description as htc_description from " . TABLE_MANUFACTURERS_INFO . " where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); else $db_query = tep_db_query("select categories_htc_title_tag as htc_title, categories_htc_description as htc_description from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'"); $htc = tep_db_fetch_array($db_query); ?>

 

Any help is appreciated very much

Thanks

David

Link to comment
Share on other sites

there is an opening tag missing right before that code shows

 

you need to add

<?php above it

 

what page are you on? is the code in the file itself or in an include?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

there is an opening tag missing right before that code shows

 

you need to add

<?php above it

 

what page are you on? is the code in the file itself or in an include?

 

Thanks Monika, that worked great? I found the code in my index.php.

 

If you could also help me with something else. I'm getting this messege at the bottom of all my pages. what is it and how can I fix it. Thanks David

 

 

 

1146 - Table 'thecageb_p_os1.TABLE_COUNTER' doesn't exist

 

select startdate, counter from TABLE_COUNTER

 

[TEP STOP]

Link to comment
Share on other sites

open includes/database_tables.php

 

for some reason you seem to be missing a default line:

define('TABLE_COUNTER', 'counter');

 

May be a good idea to compare the whole file with a vanilla one, you may have lost more lines ....

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

open includes/database_tables.php

 

for some reason you seem to be missing a default line:

define('TABLE_COUNTER', 'counter');

 

May be a good idea to compare the whole file with a vanilla one, you may have lost more lines ....

I fixed that but now I'm getting this messege:

 

 

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/thecageb/public_html/Storefront/catalog/includes/database_tables.php:63) in /home/thecageb/public_html/Storefront/catalog/includes/functions/sessions.php on line 67

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/thecageb/public_html/Storefront/catalog/includes/database_tables.php:63) in /home/thecageb/public_html/Storefront/catalog/includes/functions/sessions.php on line 67

 

 

Thanks

David

Link to comment
Share on other sites

open includes/database_tables.php

 

for some reason you seem to be missing a default line:

define('TABLE_COUNTER', 'counter');

 

May be a good idea to compare the whole file with a vanilla one, you may have lost more lines ....

 

I guess I should incude the code for that.

 

Thanks David

 

 

<?php

/*

$Id: sessions.php,v 1.19 2003/07/02 22:10:34 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if (STORE_SESSIONS == 'mysql') {

if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {

$SESS_LIFE = 1440;

}

 

function _sess_open($save_path, $session_name) {

return true;

}

 

function _sess_close() {

return true;

}

 

function _sess_read($key) {

$value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");

$value = tep_db_fetch_array($value_query);

 

if (isset($value['value'])) {

return $value['value'];

}

 

return false;

}

 

function _sess_write($key, $val) {

global $SESS_LIFE;

 

$expiry = time() + $SESS_LIFE;

$value = $val;

 

$check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");

$check = tep_db_fetch_array($check_query);

 

if ($check['total'] > 0) {

return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");

} else {

return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");

}

}

 

function _sess_destroy($key) {

return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");

}

 

function _sess_gc($maxlifetime) {

tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

 

return true;

}

 

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

}

 

function tep_session_start() {

return session_start();

}

 

function tep_session_register($variable) {

global $session_started;

 

if ($session_started == true) {

return session_register($variable);

} else {

return false;

}

}

 

function tep_session_is_registered($variable) {

return session_is_registered($variable);

}

 

function tep_session_unregister($variable) {

return session_unregister($variable);

}

 

function tep_session_id($sessid = '') {

if (!empty($sessid)) {

return session_id($sessid);

} else {

return session_id();

}

}

 

function tep_session_name($name = '') {

if (!empty($name)) {

return session_name($name);

} else {

return session_name();

}

}

 

function tep_session_close() {

if (PHP_VERSION >= '4.0.4') {

return session_write_close();

} elseif (function_exists('session_close')) {

return session_close();

}

}

 

function tep_session_destroy() {

return session_destroy();

}

 

function tep_session_save_path($path = '') {

if (!empty($path)) {

return session_save_path($path);

} else {

return session_save_path();

}

}

 

function tep_session_recreate() {

if (PHP_VERSION >= 4.1) {

$session_backup = $_SESSION;

 

unset($_COOKIE[tep_session_name()]);

 

tep_session_destroy();

 

if (STORE_SESSIONS == 'mysql') {

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');

}

 

tep_session_start();

 

$_SESSION = $session_backup;

unset($session_backup);

}

}

?>

Link to comment
Share on other sites

nope, no need for code (this time) ... right when you edited that last database_tables file you messed things up

 

see here:

 

http://www.oscommerce.info/kb/osCommerce/G...mon_Problems/15

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

nope, no need for code (this time) ... right when you edited that last database_tables file you messed things up

 

see here:

 

http://www.oscommerce.info/kb/osCommerce/G...mon_Problems/15

Monika, I have been searching my database and cannot find "counter" in there. is there a way I can create one. I think this may be my problem with:

 

1146 - Table 'thecageb_p_os1.counter' doesn't exist

 

select startdate, counter from counter

 

[TEP STOP]

 

Thanks

David

Link to comment
Share on other sites

there are two counter tables ...

 

DROP TABLE IF EXISTS counter;
CREATE TABLE counter (
 startdate char(8),
 counter int(12)
);

DROP TABLE IF EXISTS counter_history;
CREATE TABLE counter_history (
 month char(8),
 counter int(12)
);

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

there are two counter tables ...

 

DROP TABLE IF EXISTS counter;
CREATE TABLE counter (
 startdate char(8),
 counter int(12)
);

DROP TABLE IF EXISTS counter_history;
CREATE TABLE counter_history (
 month char(8),
 counter int(12)
);

Hello Monika, thanks that worked great. Another problem I have been having is. I uploaded SEO URL and I keep getting this messege:

 

Warning: call_user_func(tep_reset_cache_data_seo_urls) [function.call-user-func]: First argument is expected to be a valid callback in /home/thecageb/public_html/Storefront/catalog/admin/includes/functions/general.php on line 1266

 

It is there when I open my SEO URLs in my configuration menu. If I set the SEO URL to true i can see my main catalog page, But I can't see any other products. I just get this messege:

 

The webpage cannot be found

HTTP 404

Most likely causes:

There might be a typing error in the address.

If you clicked on a link, it may be out of date.

 

What you can try:

Retype the address.

 

Go back to the previous page.

 

Go to and look for the information you want.

 

More information

 

This error (HTTP 404 Not Found) means that Internet Explorer was able to connect to the website, but the page you wanted was not found. It's possible that the webpage is temporarily unavailable. Alternatively, the website might have changed or removed the webpage.

 

For more information about HTTP errors, see Help.

 

I have tried different things suggested by others. I even went through the setup again and checked everything over again. Is there something im missing.

 

Again thanks for all your helpI appreciate it very much

 

David

Link to comment
Share on other sites

did you upload a htacess file?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

did you upload a htacess file?

Yes it said to add this code to my htaccess file:

 

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

 

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}

 

 

the file now looks like this:

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $

#

# This is used with Apache WebServers

#

# For this to work, you must include the parameter 'Options' to

# the AllowOverride configuration

#

# Example:

#

# <Directory "/usr/local/apache/htdocs">

# AllowOverride Options

# </Catalog>

#

# 'All' with also work. (This configuration is in the

# apache/conf/httpd.conf file)

 

# The following makes adjustments to the SSL protocol for Internet

# Explorer browsers

 

<IfModule mod_setenvif.c>

<IfDefine SSL>

SetEnvIf User-Agent ".*MSIE.*" \

nokeepalive ssl-unclean-shutdown \

downgrade-1.0 force-response-1.0

</IfDefine>

</IfModule>

 

# Fix certain PHP values

# (commented out by default to prevent errors occuring on certain

# servers)

 

#<IfModule mod_php4.c>

# php_value session.use_trans_sid 0

# php_value register_globals 1

#</IfModule>

RewriteEngine On

RewriteBase /www.thecagebilliards.com/home/public_html/Storefront/catalog

 

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}

RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}

RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}

 

 

it also says: If your store is located in a DIRECTORY add this to the /*directory*/.htaccess file:

 

NOTE: you will have to edit the "directory" to match your directory name!

 

I'm not sure how i'm supposed to do this.

 

Thnx david

Link to comment
Share on other sites

your rewrite base needs to be

 

RewriteBase /Storefront/catalog/

 

also, why is your store all SSL?

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

that depends where you set it. Post the first few lines of your configure.php in catalog/includes

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

that depends where you set it. Post the first few lines of your configure.php in catalog/includes

<?php

/*

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', 'https://host445.ipowerweb.com');

define('HTTPS_SERVER', 'https://host445.ipowerweb.com');

define('ENABLE_SSL', true); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'thecagebilliards.com');

define('HTTPS_COOKIE_DOMAIN', 'host445.ipowerweb.com/~thecageb');

define('HTTP_COOKIE_PATH', '/~thecageb/Storefront/catalog/');

define('HTTPS_COOKIE_PATH', '/~thecageb/Storefront/catalog/');

define('DIR_WS_HTTP_CATALOG', '/~thecageb/Storefront/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/~thecageb/Storefront/catalog/');

Link to comment
Share on other sites

try

 

<?php
/*
 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
*/

// Define the webserver and path parameters
// * DIR_FS_* = Filesystem directories (local/physical)
// * DIR_WS_* = Webserver directories (virtual/URL)
 define('HTTP_SERVER', 'http://www.thecagebilliards.com.com');		
 define('HTTPS_SERVER', 'https://host445.ipowerweb.com/~thecageb');
 define('ENABLE_SSL', true);			// secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', '.thecagebilliards.com');
 define('HTTPS_COOKIE_DOMAIN', 'host445.ipowerweb.com/~thecageb');
 define('HTTP_COOKIE_PATH', '/Storefront/catalog/');
 define('HTTPS_COOKIE_PATH', '/Storefront/catalog/');
 define('DIR_WS_HTTP_CATALOG', '/Storefront/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '/Storefront/catalog/');

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

that depends where you set it. Post the first few lines of your configure.php in catalog/includes

Hi Monika, I am still getting this messege. After I fixed the htaccess file:

 

Warning: call_user_func(tep_reset_cache_data_seo_urls) [function.call-user-func]: First argument is expected to be a valid callback in /home/thecageb/public_html/Storefront/catalog/admin/includes/functions/general.php on line 1266

 

Is there anything else I can do?

 

Thnx David

Link to comment
Share on other sites

did you add exactly this to admin/includes/functions/general.php?

// Function to reset SEO URLs database cache entries 
// Ultimate SEO URLs v2.1
function tep_reset_cache_data_seo_urls($action){	
switch ($action){
	case 'reset':
		tep_db_query("DELETE FROM cache WHERE cache_name LIKE '%seo_urls%'");
		tep_db_query("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
		break;
	default:
		break;
}
# The return value is used to set the value upon viewing
# It's NOT returining a false to indicate failure!!
return 'false';
}

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

did you add exactly this to admin/includes/functions/general.php?

// Function to reset SEO URLs database cache entries 
// Ultimate SEO URLs v2.1
function tep_reset_cache_data_seo_urls($action){	
switch ($action){
	case 'reset':
		tep_db_query("DELETE FROM cache WHERE cache_name LIKE '%seo_urls%'");
		tep_db_query("UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='SEO_URLS_CACHE_RESET'");
		break;
	default:
		break;
}
# The return value is used to set the value upon viewing
# It's NOT returining a false to indicate failure!!
return 'false';
}

OK I got that fixed, but when I set "enable SEO URLs to "True" I can get on my main store page but I can't get to any other pages. It just sits there like its trying to find the page but won't.

 

David

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...