Forums / Templates, Stylesheets, Page Layout / Problem with auto loader (Blank line and distort character)

Problem with auto loader (Blank line and distort character)

Locked

Views: 1,554

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
8 Mar 2008, 8:04 AM
#1
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Problem with auto loader (Blank line and distort character)

I add a new class and put it in the auto_loaders with name config.xxx.php. It did initialize but when access by IE, all pages show with a blank line at the top and all characters distorted with size nearly doubled.
I have been trying the whole morning without success and cannot find an answer in this forum.
Please help!

8 Mar 2008, 8:56 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem with auto loader (Blank line and distort character)

Gamma:

... when access by IE, all pages show with a blank line at the top and all characters distorted with size nearly doubled.That's a classic symptom of extra code showing in browser source before regular page content.
If you click View Source, you'll likely see extra spaces or characters above the normal HTML content ... and those are likely located in your custom-added files ... perhaps you have left extra characters in your new files? Or maybe you have some syntax errors?

If you remove your class file (and any other related files you've added as part of this class), does the problem disappear? If so, then you know where your problem resides.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Mar 2008, 9:59 AM
#3
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Re: Problem with auto loader (Blank line and distort character)

DrByte:

If you remove your class file (and any other related files you've added as part of this class), does the problem disappear? If so, then you know where your problem resides.

I have cut the code to minimum:

In the config.xxx.php```php

<?php if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } $autoLoadConfig[190][] = array('autoType'=>'class', 'loadFile'=>'test.php'); $autoLoadConfig[200][] = array('autoType'=>'classInstantiate', 'className'=>'test', 'objectName'=>'zc_test'); ?>

In the class file:```php
<?php
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}
class test extends base {
}
?>

It does not solve the problem.

8 Mar 2008, 10:06 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem with auto loader (Blank line and distort character)

If you delete those files from the server, what happens?

What is the URL where this can be seen?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Mar 2008, 10:22 AM
#5
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Re: Problem with auto loader (Blank line and distort character)

DrByte:

If you delete those files from the server, what happens?

What is the URL where this can be seen?
DrByte. Thank you very much for your help!
After I deleted the files from the server, it returns to normal.

8 Mar 2008, 10:42 AM
#6
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Re: Problem with auto loader (Blank line and distort character)

If I insert the following lines below breakpoint 180 of config.core.php,
it works fine.

$autoLoadConfig[190][] = array('autoType'=>'class',
'loadFile'=>'test.php');
$autoLoadConfig[200][] = array('autoType'=>'classInstantiate',
'className'=>'test',
'objectName'=>'zc_test');

8 Mar 2008, 10:47 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Problem with auto loader (Blank line and distort character)

So, if it works that way, then you had done something incorrect in your custom config.xxxxxx.php file ... perhaps extra blank lines at the end of the file?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 Mar 2008, 11:04 AM
#8
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Re: Problem with auto loader (Blank line and distort character)

DrByte:

So, if it works that way, then you had done something incorrect in your custom config.xxxxxx.php file ... perhaps extra blank lines at the end of the file?

There is no blank lines at the end of the file and no space after ?>.

14 Mar 2008, 2:50 PM
#9
gamma avatar

gamma

New Zenner

Join Date:
Mar 2005
Posts:
29
Plugin Contributions:
0

Re: Problem with auto loader (Blank line and distort character)

Finally, the problem was solved by conversion of the config.xxx and class files from utf-8 to ANSI/ASCII. I don't know why it works. If someone know the reason, please tell.