Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add to Cart Error with general.php file ?


sammycom

Recommended Posts

Posted

When Add to Cart button is clicked, the page should move to shopping_cart.php. but the page would got error as the messages below with white black page.

 

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/...../html/shop/includes/functions/html_output.php:621) in /home/content/......./html/shop/includes/functions/general.php on line 33

 

the line 33 of general.php file is

 

header('Location: ' . $url);

 

============================================

21 // Redirect to another page or site

22 function tep_redirect($url) {

23 if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {

24 tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

25 }

26

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

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

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

30 }

31 }

32

33 header('Location: ' . $url);

34

35 tep_exit();

36 }

============================================

 

I'm not php coder, but I've tried several things

- blocked(commented) line 33

- blocked(commented) line 21~36 or 27~ 36 ....

but anything didnt work.!!!

 

Anyone has idea to fix this problem.

Posted

Make sure that you don't have an extra space at the end of this is files: shopping_cart.php , /include/laguages/english/shopping_cart.php or any include files that you include in your php

Posted

This typically happens when you've added whitespace (newlines or blanks) to a PHP file before the "<?php" at the beginning or after the "?>" at the end. Even for included files such as application_top.php.

Check out Chad's News.

Posted

I solved problem.

I opened html_output.php and eliminated the unnecessary white space lines after ?> at the end of file. and it worked

 

BUT !!! another next problem found.

When add to cart is clicked , the page moves to shopping_cart.php but it shows EMPTY CART without any error message.

 

what should I DO???

Archived

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

×
×
  • Create New...