Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Almost Ready to go live


judoka

Recommended Posts

Posted

Hi everybody, I am also ready to go live and I am in the process of testing before going live, however I am running into a few errors messages and I'm hoping that someone can me help with the following errors:

 

1) When trying to log-in or setup a new account I get:

Warning: Cannot add header information - headers already sent by (output started at c:program fileseasyphpwwwcatalogincludesapplication_top.php:2048) in c:program fileseasyphpwwwcataloglogin.php on line 43

 

Warning: Cannot add header information - headers already sent by (output started at c:program fileseasyphpwwwcatalogincludesapplication_top.php:2048) in c:program fileseasyphpwwwcatalogincludesfunctionsgeneral.php on line 23

however if I hit my back buttom on my browser, I'm login, go figure :? :?

 

2) When logging off I get the follow error:

Warning: Cannot add header information - headers already sent by (output started at c:program fileseasyphpwwwcatalogincludesapplication_top.php:2048) in c:program fileseasyphpwwwcatalogincludesfunctionsgeneral.php on line 23

however if I hit my back buttom on my browser, I'm log-off. :? :?

 

3) When I am log-on and I try editting the account info I get the following error:

Parse error: parse error, unexpected $ in c:program fileseasyphpwwwcatalogaccount_edit_process.php on line 310

 

4) During the checkout process I get this error:

Warning: Cannot add header information - headers already sent by (output started at c:program fileseasyphpwwwcatalogincludesapplication_top.php:2048) in c:program fileseasyphpwwwcatalogincludesfunctionsgeneral.php on line 23

 

I believe that the problem is somewhere between the general.php and the application_top.php but I am not that familar with PHP to be able to figure out which one or what to look for. I am working on my local machine using winXP before going live and I am not sure if that is the problem. Thanks in advise for any and all help. Thank You. :D :D

Posted

That warning is usually caused whe n you have trailing spaces at the end of one of those files. Delete the spaces after the last > & your problem will hopefully go away.

fingers crossed for you.

Posted

Hi Freerangemum,

Thank you very much for your help, :D I did as you said and it took care of most of my problem except for number 3 which is,

 

3) When I am log-on and I try editing the account info I get the following error:

Parse error: parse error, unexpected $ in c:program fileseasyphpwwwcatalogaccount_edit_process.php on line 310

 

but the line number has change to 309

 

Also when I try checking out, I can now get to the first stage which is the customer general information but when I click "Continue" it just keeps looping back to the general information screen and won't go to the payment information screen. Would you know what is causing this problem? :wink: Thank you for your help. I really do appreciate it.

Posted

What is on line 310 of your account_edit_process.php? Can you post the code with about 10 lines before & after?

Posted

This is what I have Starting at line 300

 

if ($zone_id > 0) {

$sql_data_array['entry_zone_id'] = $zone_id;

$sql_data_array['entry_state'] = '';

} else {

$sql_data_array['entry_zone_id'] = '0';

$sql_data_array['entry_state'] = $state;

}

}

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . tep_db_input($customer_id) . "' and address_book_id = '" . tep_db_input($customer_default_address_id) . "'");

 

tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . tep_db_input($customer_id) . "'");

 

$customer_country_id = $country;

$customer_zone_id = $zone_id;

 

tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

}

 

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

 

 

I just notice that on the eleven line down which is,

 

$sql_data_array, 'update', "customers_id = '" . tep_db_input

 

should this read as,

 

$sql_data_array, 'update', "customers_id = " . tep_db_input

 

or maybe

 

$sql_data_array, 'update', "'customers_id = '" . tep_db_input

 

If this is the problem line???

Thank You for your help and time :D

Posted

The problem you have is almost certainly due to a missing curly bracket. I cant see anything out of place in what you posted, so perhaps you need to look earlier in that file to make sure that every '{' has a '}'.

Sorry I can't be more specific about where to look.

Posted

Hi Freerangemum,

Thank you for all your help, I looked over the entire account_edit_process.php twice but I couldn't find any missing or out of place curly or anything else out of place that I could tell, so I guess I'll put that one aside for later or tomorrow so I can look at it with a fresh set of eyes :shock: :lol:

One other question if you don't mind, during the checkout process when I click on checkout I can get to the first step of the process which is the Delivery Information, however in the shipping method field I see the following message

 

"This is currently the only shipping method available to use on this order."

 

but I don't not see any of the shipping methods that I have enable in the admin. I have UPS and FedEX enable but they don't show up here. Also when I click on continue rather than going to the next step which is the payment information screen, it just loops back to the delivery information screen. Would you know what is causing these problems? :? :?

Posted

Could you please post the entire code of your account edit process? I will have a look then ;-)

 

Regards Matt

Posted

Thanks mattkhan,

Here is the code,

 

<?php

/*

 $Id: account_edit_process.php,v 1.2 2002/11/28 23:39:44 wilt Exp $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2002 osCommerce



 Released under the GNU General Public License

*/



 require('includes/application_top.php');



 if (!tep_session_is_registered('customer_id')) {

   $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_ACCOUNT_EDIT));

   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 }



 if ($HTTP_POST_VARS['action'] != 'process') {

   tep_redirect(tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));

 }



 $gender = tep_db_prepare_input($HTTP_POST_VARS['gender']);

 $firstname = tep_db_prepare_input($HTTP_POST_VARS['firstname']);

 $lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

 $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']);

 $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);

 $telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);

 $fax = tep_db_prepare_input($HTTP_POST_VARS['fax']);

 $newsletter = tep_db_prepare_input($HTTP_POST_VARS['newsletter']);

 $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

 $confirmation = tep_db_prepare_input($HTTP_POST_VARS['confirmation']);

 $street_address = tep_db_prepare_input($HTTP_POST_VARS['street_address']);

 $company = tep_db_prepare_input($HTTP_POST_VARS['company']);

 $suburb = tep_db_prepare_input($HTTP_POST_VARS['suburb']);

 $postcode = tep_db_prepare_input($HTTP_POST_VARS['postcode']);

 $city = tep_db_prepare_input($HTTP_POST_VARS['city']);

 $zone_id = tep_db_prepare_input($HTTP_POST_VARS['zone_id']);

 $state = tep_db_prepare_input($HTTP_POST_VARS['state']);

 $country = tep_db_prepare_input($HTTP_POST_VARS['country']);



 $error = false; // reset error flag



 if (ACCOUNT_GENDER == 'true') {

   if (($gender == 'm') || ($gender == 'f')) {

     $entry_gender_error = false;

   } else {

     $error = true;

     $entry_gender_error = true;

   }

 }



 if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {

   $error = true;

   $entry_firstname_error = true;

 } else {

   $entry_firstname_error = false;

 }



 if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {

   $error = true;

   $entry_lastname_error = true;

 } else {

   $entry_lastname_error = false;

 }



 if (ACCOUNT_DOB == 'true') {

   if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4))) {

     $entry_date_of_birth_error = false;

   } else {

     $error = true;

     $entry_date_of_birth_error = true;

   }

 }



 if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {

   $error = true;

   $entry_email_address_error = true;

 } else {

   $entry_email_address_error = false;

 }



 if (!tep_validate_email($email_address)) {

   $error = true;

   $entry_email_address_check_error = true;

 } else {

   $entry_email_address_check_error = false;

 }



 if (strlen($street_address) < ENTRY_STREET_ADDRESS_MIN_LENGTH) {

   $error = true;

   $entry_street_address_error = true;

 } else {

   $entry_street_address_error = false;

 }



 if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {

   $error = true;

   $entry_post_code_error = true;

 } else {

   $entry_post_code_error = false;

 }



 if (strlen($city) < ENTRY_CITY_MIN_LENGTH) {

   $error = true;

   $entry_city_error = true;

 } else {

   $entry_city_error = false;

 }



 if (!is_numeric($country)) {

   $error = true;

   $entry_country_error = true;

 } else {

   $entry_country_error = false;

 }



 if (ACCOUNT_STATE == 'true') {

   if ($entry_country_error) {

     $entry_state_error = true;

   } else {

     $zone_id = 0;

     $entry_state_error = false;

     $country_check_query = tep_db_query("select count(*) as total from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "'");

     $country_check = tep_db_fetch_array($country_check_query);

     if ($entry_state_has_zones = ($country_check['total'] > 0)) {

       $match_zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_name = '" . tep_db_input($state) . "'");

       if (tep_db_num_rows($match_zone_query) == 1) {

         $match_zone = tep_db_fetch_array($match_zone_query);

         $zone_id = $match_zone['zone_id'];

       } else {

         $match_zone_query = tep_db_query("select zone_id from " . TABLE_ZONES . " where zone_country_id = '" . tep_db_input($country) . "' and zone_code = '" . tep_db_input($state) . "'");

         if (tep_db_num_rows($match_zone_query) == 1) {

           $match_zone = tep_db_fetch_array($match_zone_query);

           $zone_id = $match_zone['zone_id'];

         } else {

           $error = true;

           $entry_state_error = true;

         }

       }

     } elseif (strlen($state) < ENTRY_STATE_MIN_LENGTH) {

       $error = true;

       $entry_state_error = true;

     }

   }

 }



 if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {

   $error = true;

   $entry_telephone_error = true;

 } else {

   $entry_telephone_error = false;

 }



 if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {

   $error = true;

   $entry_password_error = true;

 } else {

   $entry_password_error = false;

 }



 if ($password != $confirmation) {

   $error = true;

   $entry_password_error = true;

 }



 $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and customers_id != '" . tep_db_input($customer_id) . "'");

 $check_email = tep_db_fetch_array($check_email_query);

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

   $error = true;

   $entry_email_address_exists = true;

 } else {

   $entry_email_address_exists = false;

 }



 if ($error == true) {

   $processed = true;



   include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_EDIT_PROCESS);



   $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

   $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'));

?>

<!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; ?>">

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

 require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?> 

 <title><?php echo TITLE ?></title>

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v1.0

?>

<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="<? echo THEMA_STYLE;?>">

<?php require('includes/form_check.js.php'); ?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_CLASSES . 'thema/' . SITE_THEMA . '/thema_header.php'); ?>

<!-- header_eof //-->



<!-- body //-->

<center>

<table border="0" width="<?php echo SITE_WIDTH; ?>" cellspacing="0" cellpadding="13" class="centerTable">

 <tr>

   <td width="<?php echo BOX_WIDTH; ?>" valign="top" class="leftColumn"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_CLASSES . 'thema/' . SITE_THEMA . '/thema_column_left.php'); ?>

<!-- left_navigation_eof //-->

   </table></td>

<!-- body_text //-->

   <td width="100%" valign="top"><?php echo tep_draw_form('account_edit', tep_href_link(FILENAME_ACCOUNT_EDIT_PROCESS, '', 'SSL'), 'post', 'onSubmit="return check_form();"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

     <tr>

       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php if (DISPLAY_HEADER_IMAGE =='true') { ?>

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_account.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

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

     </tr>

     <tr>

       <td><?php include(DIR_WS_MODULES . 'account_details.php'); ?></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 class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

           <td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

         </tr>

       </table></td>

     </tr>

   </table></form></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 include(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

   </table></td>

 </tr>

</table>

<!-- body_eof //-->



<!-- footer //-->

<?php include(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php

 } else {

   $sql_data_array = array('customers_firstname' => $firstname,

                           'customers_lastname' => $lastname,

                           'customers_email_address' => $email_address,

                           'customers_telephone' => $telephone,

                           'customers_fax' => $fax,

                           'customers_newsletter' => $newsletter,

                           'customers_password' => crypt_password($password));



   if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $gender;

   if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = tep_date_raw($dob);



   tep_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . tep_db_input($customer_id) . "'");



   $sql_data_array = array('entry_street_address' => $street_address,

                           'entry_firstname' => $firstname,

                           'entry_lastname' => $lastname,

                           'entry_postcode' => $postcode,

                           'entry_city' => $city,

                           'entry_country_id' => $country);



   if (ACCOUNT_GENDER == 'true') $sql_data_array['entry_gender'] = $gender;

   if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;

   if (ACCOUNT_SUBURB == 'true') $sql_data_array['entry_suburb'] = $suburb;

   if (ACCOUNT_STATE == 'true') {

     if ($zone_id > 0) {

       $sql_data_array['entry_zone_id'] = $zone_id;

       $sql_data_array['entry_state'] = '';

     } else {

       $sql_data_array['entry_zone_id'] = '0';

       $sql_data_array['entry_state'] = $state;

     }

   }



   tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . tep_db_input($customer_id) . "' and address_book_id = '" . tep_db_input($customer_default_address_id) . "'");



   tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_account_last_modified = now() where customers_info_id = '" . tep_db_input($customer_id) . "'");



   $customer_country_id = $country;

   $customer_zone_id = $zone_id;



   tep_redirect(tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

 }



 require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

Posted

Hi Judoka,

 

you do have an if statement at line 223:

 

<?php if (DISPLAY_HEADER_IMAGE =='true') { ?>

 

It seems to me that this statment is missing its closing "}".

 

I don't know what part exactly should be left out when DISPLAY_HEADER_IMAGE != true so you have to decide yourself. Anyhow to place this if stament there only makes sence when you want to leave out line 224 (<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>)! If you want o leave out line 225 as well, you would be left with an incorrect TABLE Syntax! It might still look correct in your browser, but I would try to avoid that.

 

If you need more help, tell me which part should be left out with that statement, and I'll send you the code ;-)

 

Hope that helps,

 

regards Matt

Posted

Hi Mattkhan, Thanks for pointing me in the right direction. :D :D I was missing a closing curly at the following location,

 

if($error==true) {

 

It was located at around line 159. I wasn't sure where to put the closing curly so I kind of play around with it a bit and it seen to like the end of line 163 the best, However I still have a problem with it when I try to edit my account I now get the following error,

 

Parse error: parse error, unexpected $ in c:program fileseasyphpwwwcatalogaccount_edit_process.php on line 535

 

I looked around but I couldn't find any extra $ any where, so I guess I'm kind of back to square one :( Do you have any :idea: :idea: :idea: ? Thanks for your help :D :D

Posted

Hi Judoka,

 

you shouldn't close if($error==true){ because that if clause will be closed by the }else{ at line 263.

 

I would try to erase <?php if (DISPLAY_HEADER_IMAGE =='true') { ?> at line 222 to see if that helps. However you might have added this if clause for a good reason, so you must find out what exactly should be left out if the DISPLAY_HEADER_IMAGE =='false'.

 

As said for testing purpose I wol take it out to see if taht fixes teh problem.

 

Your parse error you get usually indicates that you have a missing } somewhere. Unfortunately the PHP parsers can't tell before the last line of the code that it is actually missing. That's why it's always giving you the last line as the place of error.

 

Regards Alex

Posted

Hi Matt, Thanks for the advise. I going to put this on hold for a couple of days, I aleady lost alot of time on it with no luck and I still have a few this to do before I can go live. So I'm going to work on that and than come back again later to this problem. I'll let you know how it goes when I get back to it. Again thank you for all your help. :D :D

Archived

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

×
×
  • Create New...