Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header tags


jmbrkich

Recommended Posts

Installed Header Tags and when you go to my online store, some of the pages work and others are showing a parse error. Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in

/hsphere/local/home/jmbrkich/1stopshoppingconnection.com/database_setup.php on line 18.

 

Below is my database_setup.php file:

<?php /* $Id: database_setup.php, v 1.00 by Jack York 12-04-04 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ require(admin/includes/application_top.php'); $htc_check_query = tep_db_query("select * from products_description"); for ($ctr = 0; $ctr < tep_db_fetch_fields($htc_check_query); $ctr++) { if (false != strstr(mysql_field_name($htc_check_query, $ctr),

'products_head_title_tag')) { echo 'Looks like Header Tags is already installed. Aborting...'; tep_exit(); } } $line = array("ALTER TABLE categories ADD category_head_title_tag

VARCHAR(80) NULL;"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE categories ADD category_head_desc_tag LONGTEXT

NULL;"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE categories ADD category_head_keywords_tag

LONGTEXT NULL;"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE categories ADD category_head_description LONGTEXT

NULL;"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE products_description ADD products_head_title_tag

VARCHAR(80) NULL"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE products_description ADD products_head_desc_tag

LONGTEXT NULL"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } $line = array("ALTER TABLE products_description ADD

products_head_keywords_tag LONGTEXT NULL"); foreach ($line as $value) { if (tep_db_query($value) == false) { $db_error = true; break; } } ?> <!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 marginwidth="0" marginheight="0" topmargin="0" bottommargin="0"

leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0"

width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%"

cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo 'Header Tags Controller Setup';

?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');

?></td> </tr> <tr> <td class="main"> <?php if ($db_error == false) { echo 'Database successfully updated!!!'; } else { echo 'Error encountered during database update.'; } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10');

?></td> </tr> </table></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0"

width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

Also some php script is showing up on some of my pages but not all of them. This is what is showing at the top:

$category_query = tep_db_query("select c.category_head_title_tag, c.category_head_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?>

 

I'm real new at this. Muddling my way through.

Thanks,

Joanne

Link to comment
Share on other sites

Noticed code was not properly entered so am reentering it.

<?php
/*
?$Id: database_setup.php, v 1.00 by Jack York 12-04-04

?osCommerce, Open Source E-Commerce Solutions
?http://www.oscommerce.com

?Copyright (c) 2003 osCommerce

?Released under the GNU General Public License
*/

?require(admin/includes/application_top.php');

$htc_check_query = tep_db_query("select * from products_description");

?for ($ctr = 0; $ctr < tep_db_fetch_fields($htc_check_query); $ctr++) {
?	if (false != strstr(mysql_field_name($htc_check_query, $ctr), 'products_head_title_tag')) {
? ?echo 'Looks like Header Tags is already installed. Aborting...';
? ?tep_exit();
? }
}
?$line = array("ALTER TABLE categories ADD category_head_title_tag VARCHAR(80) NULL;");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}
?$line = array("ALTER TABLE categories ADD category_head_desc_tag LONGTEXT NULL;");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}
?$line = array("ALTER TABLE categories ADD category_head_keywords_tag LONGTEXT NULL;");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}
?$line = array("ALTER TABLE categories ADD category_head_description LONGTEXT NULL;");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}

?$line = array("ALTER TABLE products_description ADD products_head_title_tag VARCHAR(80) NULL");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? ?break;
? ?}
?}
?$line = array("ALTER TABLE products_description ADD products_head_desc_tag LONGTEXT NULL");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}
?$line = array("ALTER TABLE products_description ADD products_head_keywords_tag LONGTEXT NULL");
?foreach ($line as $value) {
? ?if (tep_db_query($value) == false) {
? ? ?$db_error = true;
? break;
? ?}
?}
?>
<!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 marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
?<tr>
? ?<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
? ?</table></td>
<!-- body_text //-->
? ?<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
? ? ?<tr>
? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="pageHeading"><?php echo 'Header Tags Controller Setup'; ?></td>
? ? ? ? ?</tr>
? ? ? ?</table></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td class="main">
<?php
?if ($db_error == false) {
? ?echo 'Database successfully updated!!!';
?} else {
? ?echo 'Error encountered during database update.';
?}
?>
? ? ? ?</td>
? ? ?</tr>
? ? ?<tr>
? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ?</tr>
? ?</table></td>
<!-- body_text_eof //-->
? ?<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
? ?</table></td>
?</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

This is line 18:

if (false != strstr(mysql_field_name($htc_check_query, $ctr), 'products_head_title_tag')) {

Edited by jmbrkich
Link to comment
Share on other sites

The database_setup.php file is a one time script that you run to make changes to your database. It should not be failing like that but even if it is, it is not required. You can make the database changes using phpmyadmin. Either way though, the database changes have to be made before you can do anything else.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

The database_setup.php file is a one time script that you run to make changes to your database.  It should not be failing like that but even if it is, it is not required. You can make the database changes using phpmyadmin.  Either way though, the database changes have to be made before you can do anything else.

 

Jack

 

 

Thank you Jack. Why would php script be showing on my website?

Link to comment
Share on other sites

It can only show if you deliberately try to address it. If it is showing up through some link, then there is a problem in the code.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

It can only show if you deliberately try to address it. If it is showing up through some link, then there is a problem in the code.

 

Jack

 

 

The funny thing is it doesn't show up on all pages. When I go to my website:

http://www.1stopshoppingconnection.com all is fine until I click on some of the categories which expand to sub-categories and that is where I find it under the top banner.

Here is the code:

Also some php script is showing up on some of my pages but not all of them. This is what is showing at the top:
$category_query = tep_db_query("select c.category_head_title_tag, c.category_head_description from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?>

Edited by jmbrkich
Link to comment
Share on other sites

Yup, it looks like you messed up when you installed something.

 

Looks like something to do with your catalog tree transversal.

http://1stopshoppingconnection.com/catalog...php?cPath=25_37

 

I'd suggest reverting to the backup you made before you attempted to install, and try again. Pay particular attention to anything that inserts or alters anythign around $category_query = tep_db_query(" , as this seems to be where you deviated from.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

The funny thing is it doesn't show up on all pages.  When I go to my website:

http://www.1stopshoppingconnection.com all is fine until I click on some of the categories which expand to sub-categories and that is where I find it under the top banner.

OK, that is a diiferent problem than the one I thought you were having. That is caused by a problem in your index.php file. Reload the index.php file and install the changes into it one at a time, testing the page each time between the changes if you want to do it the safe way. The rest of the pages appear to work correctly so fixing this one file should make everything OK.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

OK, that is a diiferent problem than the one I thought you were having. That is caused by a problem in your index.php file. Reload the index.php file and install the changes into it one at a time, testing the page each time between the changes if you want to do it the safe way.  The rest of the pages appear to work correctly so fixing this one file should make everything OK.

 

Jack

 

 

Jack,

This is a different issue on top of my other problem. I will try what you have suggested. Thank you.

Joanne

Link to comment
Share on other sites

Yup, it looks like you messed up when you installed something.

 

Looks like something to do with your catalog tree transversal.

http://1stopshoppingconnection.com/catalog...php?cPath=25_37

 

I'd suggest reverting to the backup you made before you attempted to install, and try again. Pay particular attention to anything that inserts or alters anythign around $category_query = tep_db_query(" , as this seems to be where you deviated from.

 

 

Thanks, Chris. I'll try again.

Joanne

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...