Results 1 to 4 of 4
-
10th Jun 2010, 09:53 PM #1OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comBOM Detection cleaner!
BOM Characters can cause issues in your website
http://en.wikipedia.org/wiki/Byte_order_mark
there a small characters put in your files text editors..
the last few weeks iv'e fixed a few sites with BOM trouble and there hard to find because you cant see them.
below is a script to find them out, run this script from your public_html folder and see if it can seek any out.
once found open the file in notepad++ and go to the drop-down menu "Encoding" and select "Encode UTF-8 Without BOM".
Save and upload the file and should be fixed.
BOM cases issues like "headers already sent" and invalid code when trying to validate html with w3c.
PHP Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PHP BOM Finder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { font-family: arial, verdana, sans-serif }
p { margin-left: 20px }
</style>
</head>
<body>
<h1>UTF-8 BOM seek</h1>
<p>
<?php
$total = CheckDir( '../');
echo '<br /> Number of files with UTF-8 BOM: ', $total ;
function CheckDir( $sourceDir )
{
$counter = 0 ;
$sourceDir = FixDirSlash( $sourceDir ) ;
// Copy files and directories.
$sourceDirHandler = opendir( $sourceDir ) ;
while ( $file = readdir( $sourceDirHandler ) )
{
// Skip ".", ".." and hidden fields (Unix).
if ( substr( $file, 0, 1 ) == '.' )
continue ;
$sourcefilePath = $sourceDir . $file ;
if ( is_dir( $sourcefilePath ) )
{
$counter += CheckDir( $sourcefilePath ) ;
}
if ( !is_file( $sourcefilePath ) || @GetFileExtension( $sourcefilePath ) != 'php' || !CheckUtf8Bom( $sourcefilePath ) ){
echo 'CLEAN:'.$sourcefilePath. '<br />' ;
}else{
echo 'DETECTED:'.$sourcefilePath. '<br />' ;
}
$counter++ ;
}
return $counter ;
}
function FixDirSlash( $dirPath )
{
$dirPath = str_replace( '\\', '/', $dirPath ) ;
if ( substr( $dirPath, -1, 1 ) != '/' )
$dirPath .= '/' ;
return $dirPath ;
}
function GetFileExtension( $filePath )
{
$info = pathinfo( $filePath ) ;
return $info['extension'] ;
}
function CheckUtf8Bom( $filePath )
{
$data = file_get_contents( $filePath ) ;
return ( substr( $data, 0, 3 ) == "\xEF\xBB\xBF" ) ;
}
?>
</p>
</body>
</html>
Peacelitewarez Reviewed by litewarez on . BOM Detection cleaner! BOM Characters can cause issues in your website http://en.wikipedia.org/wiki/Byte_order_mark there a small characters put in your files text editors.. the last few weeks iv'e fixed a few sites with BOM trouble and there hard to find because you cant see them. below is a script to find them out, run this script from your public_html folder and see if it can seek any out. once found open the file in notepad++ and go to the drop-down menu "Encoding" and select "Encode UTF-8 Without Rating: 5Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
10th Jun 2010, 09:56 PM #2mmm mmm!
what is bom characters?
HATERS GONNA probably bring up some valid points considering I am an ignorant little twat so far up my own ass that i blame my problems on everyone and if you criticize me you're automatically wrong.
-
10th Jun 2010, 09:57 PM #3MemberWebsite's:
*************** IMGscene.comThanks for this!
He fixed some errors on my site.
-
10th Jun 2010, 09:58 PM #4OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comJoin Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Music from a dry cleaner
By Anthonis in forum General DiscussionReplies: 0Last Post: 21st Sep 2011, 07:23 AM -
Help! My nfo Cleaner is not really working
By otti in forum Webmaster ResourcesReplies: 0Last Post: 12th Dec 2010, 10:32 AM -
Review DDL0v2 - Cleaner, Sleeker & Faster
By SJshah in forum Site ReviewsReplies: 32Last Post: 30th Jul 2010, 09:26 PM -
avast detection
By koullis in forum Technical Help Desk SupportReplies: 4Last Post: 18th May 2009, 09:24 AM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...