Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Garbage text at top of page after website transfer

Posted on 2014-02-05
8
Medium Priority
?
282 Views
Last Modified: 2014-02-06
I am just in the process of transferring a website, but on the new server I am getting garbage text at the top of the page. See http://46.32.231.136/~marblele/

The software used on this website is http://www.open-realty.org

Any idea why the garbage text is there and how to get rid of it?
0
Comment
Question by:petewinter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39836313
Looks like Unicode characters in one of your pages.
0
 

Author Comment

by:petewinter
ID: 39836357
Thanks, but any idea how to get rid of it?
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 400 total points
ID: 39836374
Check you top level pages i.e. open them and have a look, (and make sure they are encoded as UTF-8 without BOM as this will make sure any Unicode will show up incase they are 'hidden')
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1600 total points
ID: 39836445
Looks like invalid Unicode characters!

http://validator.w3.org/check?uri=http%3A%2F%2F46.32.231.136%2F~marblele%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

This will give you a little more guidance about character-encoding issues.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11880-Unicode-PHP-and-Character-Collisions.html

The fact that the pattern of junk is repeated four times might be an important clue.  How many include() steps are done before the browser output is started?  If it's four, you may find that all of your sub-scripts are spitting out a bit of junk.
0
 

Author Comment

by:petewinter
ID: 39838466
Thanks for the advice all. I have narrowed the issue down to the code below...

error_reporting(E_ALL& ~E_NOTICE);
global $lang;
$lang = array();
if ($handle = opendir(dirname(__FILE__).'/versions')) {
	while (false !== ($file = readdir($handle))) {
		if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn") {
			if (!is_dir(dirname(__FILE__).'/versions/' . $file)) {
				include(dirname(__FILE__).'/versions/' . $file);
				}
			}
		}
	closedir($handle);
	}
if ($handle = opendir(dirname(__FILE__).'/custom')) {
	while (false !== ($file = readdir($handle))) {
		if ($file != "." && $file != ".." && $file != "CVS" && $file != ".svn") {
			if (!is_dir(dirname(__FILE__).'/custom/' . $file)) {
				include(dirname(__FILE__).'/custom/' . $file);
				}
			}
		}
	closedir($handle);
	}

Open in new window


Any idea what is wrong with the above?
0
 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1600 total points
ID: 39838648
There might be nothing wrong with the above.  All it does is include() some files.  You might want to look into those /versions/ and /custom/ directories.  Open each of the files in those directories with a text editor (not Notepad) and save them in UTF-8 without Byte Order Marks.  I am not sure this will fix it, but there is a chance it might.  

Another thing to look for would be garbage in the files themselves.

You might also want to rethink this:
error_reporting(E_ALL& ~E_NOTICE);

What that line of code means to you is that if you make a typographical error somewhere in that script or in any other script included after that script, PHP will not tell you about it.  Instead PHP will silently ignore reliance on undefined variables.  This is AntiPractice #4 -- it can make debugging very, very difficult.

You might also want to ask yourself what purpose the $lang variable plays.  It appears to be injected into the symbol table, and made global (why?) but not used in the script.
0
 

Author Closing Comment

by:petewinter
ID: 39838987
Many thanks. You advice has help me find a solution
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 39839084
Thanks for the points.  Best of luck with the project, ~Ray
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question