Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

header related warning when redirecting page to pay. gateway


TheFinnisher

Recommended Posts

Posted

I get this warning when I process my payment. (I'm using Linkpoint):

 

Warning: Cannot add header information - headers already sent by (output started at /home/crs/includes/linkpoint/lpphp.php:555) in /home/crs/includes/functions/general.php on line 29

 

This is the code in functions/general.php that it is referring to:

 

////

// Redirect to another page or site

 function tep_redirect($url) {

   if ( (ENABLE_SSL == true) && (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();

 }

 

I only see the warning when I run the Linkpoint script in debug mode. Otherwise the payment is processing well. Is this a serious problem? Does it slow down the processing? Is there anything I can do? Could I for instance change the name header to header2? and where else would I have to do it if so?

 

Thanks!

Posted

Open your linkpoint file in your text editor... place your mouse cursor after the closing ?> tag, and hit your delete key to remove any whitespace

Posted

Hey Matti,

Thanks for your help! I did open up my lpphp.php file and removed all the whitespace at the bottom. That didn't help...Do I need to remove whitespace anywhere else? I would think that the professional Linkpoint people would have made their file in a proper way...

 

Actually I found a bug in their script. They had previously made a mistake in their szip parameter. It had a duplicate entry or something...

 

I'm thinking that this issue relates rather to a sharing problem somehow since the warning speaks about the same header issue...

 

Any other ideas? I'm not much of a programmer but I have learned to adapt quite a bit of code here with osCommerce.

 

I'm actually rewriting and improving the Linkpoint module. Do you use Linkpoint? and could the error relate to my module?

 

ANOTHER question for you...which doesn't relate to this topic..DO you by any chance have Finnish roots? Your first name is SO Finnish.

 

Thanks again. Maybe I'll get this thing resolved sooner than later...

Posted

There can be whitespace at the beginning of the file also - whitespace is the most common cause of the error you have..... your error states that the output started:

 

lpphp.php:555

 

This means line 555 in this file, so take a look here. :shock:

 

Yes, I am a Finn - born in Helsinki, raised in Australia 8)

Posted

Matti,

I tried to remove all the whitespace and nothing changed. I looked closer on the lpphp code and I think that this warning might only relate to when one tries to debug the payment into XML.

 

This is the code that stands just before line 555:

 

###############################

#      b u i l d X M L        #

###############################



function buildXML($pdata)

{

       if ($this->DEBUGGING == 1)

 {

	 echo "nat buildXML, incoming hash:n";

	 while (list($key, $value) = each($pdata))

   echo "$key = $value n";

 }



 $xml = "<order><orderoptions>";



 if (isset($pdata["chargetype"]))

	 $xml .= "<ordertype>" . $pdata["chargetype"] . "</ordertype>";



 if (isset($pdata["result"]))

	 $xml .= "<result>" . $pdata["result"] . "</result>";



 $xml .= "</orderoptions>";

 

and at the very top of this file you can specify the XML debug to work or not...like:

 

        $this->DEBUGGING     = 0;       # diagnostic output          default=0=none

                                       #                                    1=ON

 

Linkpoint asked me to run it in debug mode once when I was having problems with one of their parameters...

 

So with the above code, I suspect that the warning only happens when being run in the debug mode... I get no warning when running in normal mode. :)

 

I sent in a request for Linkpoint to have a look at this so maybe, they will get to it one day...

 

Hey, cool that you were born in Finland. So was I. but I'm living in the USA right now. I can see your use of smily face 8) . Those sunglasses aren't needed much of the year in Finland! :P

 

California is 8) as well!

 

Have a good one!

Archived

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

×
×
  • Create New...