Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting Weired Message About..


Guest

Recommended Posts

On my store front I am getting this weired message about the general.php file. It was only happening when you tried to add the product to the shopping cart and know it is doing it on just about everything. I am really in left field with this. I understand a little about php web sites but not enough to getr my butt out of this one. Any help would be welcomed greatly.

 

Thanks

 

Josh

 

http://www.precision-boats.com/catalog

Link to comment
Share on other sites

post the few lines around line 23 of home/josh/public_html/catalog/includes/functions/general.php

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

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

Here are the first lines from that file.

 

Thanks

Josh

 

<?php

/*

$Id: general.php,v 1.231 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

////

// Stop from parsing any further PHP code

function tep_exit() {

tep_session_close();

exit();

}

 

////

// Redirect to another page or site

function tep_redirect($url) {

if ( (ENABLE_SSL == true) &amp;&amp; (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

if (substr($url, 0, strlen(HTTP_SERVER)) == HTTP_SERVER) { // NONSSL url

$url = HTTPS_SERVER . substr($url, strlen(HTTP_SERVER)); // Change it to SSL

}

}

 

header('Location: ' . $url);

 

tep_exit();

}

 

////

// Parse the data used in the html tags to ensure the tags will not break

function tep_parse_input_field_data($data, $parse) {

return strtr(trim($data), $parse);

}

 

function tep_output_string($string, $translate = false, $protected = false) {

if ($protected == true) {

return htmlspecialchars($string);

} else {

if ($translate == false) {

return tep_parse_input_field_data($string, array('"' => '"'));

} else {

return tep_parse_input_field_data($string, $translate);

}

}

}

 

function tep_output_string_protected($string) {

return tep_output_string($string, false, true);

}

 

function tep_sanitize_string($string) {

$string = ereg_replace(' +', ' ', trim($string));

 

return preg_replace("/[<>]/", '_', $string);

}

 

////

// Return a random row from a database query

function tep_random_select($query) {

$random_product = '';

$random_query = tep_db_query($query);

$num_rows = tep_db_num_rows($random_query);

if ($num_rows > 0) {

$random_row = tep_rand(0, ($num_rows - 1));

tep_db_data_seek($random_query, $random_row);

$random_product = tep_db_fetch_array($random_query);

}

 

return $random_product;

}

 

////

// Return a product's name

// TABLES: products

function tep_get_products_name($product_id, $language = '') {

global $languages_id;

 

if (empty($language)) $language = $languages_id;

 

$product_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$product_id . "' and language_id = '" . (int)$language . "'");

$product = tep_db_fetch_array($product_query);

 

return $product['products_name'];

}

Link to comment
Share on other sites

LOL, that's not exactly "a few lines". You make it difficult for people to help. If you had just posted a few lines, I could have spotted the parse error and told you what it was, but when you post the entire thing, I have to copy it to an editor that has line numbers so that I can find where the error is. Make sure you read directions a little more carefully, and that might help you with your work on OSCommerce in general.

 

Anyways, it looks like you error is here....

 

if ( (ENABLE_SSL == true) &amp;&amp; (getenv('HTTPS') == 'on') ) { // We are loading an SSL page

 

Should be

if ( (ENABLE_SSL == true) &&(getenv('HTTPS') == 'on') ) { // We are loading an SSL page

 

Or

if ( (ENABLE_SSL == true) &$amp;(getenv('HTTPS') == 'on') ) { // We are loading an SSL page

 

Either should work. I assume you must have modified this line when you instaelled a contribution or something?

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

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

Thanks for the help. Yeah I posted that in a hurry so I could get to lunch. Thanks for the help, lets see if it works. I didn't change it manually wonder if it changed by itself? Weired. Ok know it says line 662. This is what that line says....

 

 

while ( ($flag == 'on') &amp;amp;&amp;amp; ($k < count($pieces)) ) {

while (substr($pieces[$k], -1) == ')') {

$post_objects[] = ')';

if (strlen($pieces[$k]) > 1) {

$pieces[$k] = substr($pieces[$k], 0, -1);

} else {

$pieces[$k] = '';

}

}

Link to comment
Share on other sites

Hmmn, that's weird. Not sure why it's doing that. It might have somethign to do with the way you are uploading the files, such as through a cpanel file manager.

 

Replace the

 

&amp;amp;&amp;amp;

 

with

 

&&

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

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

Chris,

 

Really weired, when I make the changes it goes abck and forth from line 662 to line 23?? Maybe unistall and start over?? Is there anything else I can give you chris to help out??

 

Thanks

Josh

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...