Activity Stream
48,167 MEMBERS
61017 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com

    Default 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 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 ;

        
    $sourceDir FixDirSlash$sourceDir ) ;

        
    // Copy files and directories.
        
    $sourceDirHandler opendir$sourceDir ) ;

        while ( 
    $file readdir$sourceDirHandler ) )
        {
            
    // Skip ".", ".." and hidden fields (Unix).
            
    if ( substr$file0) == '.' )
                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) != '/' )
            
    $dirPath .= '/' ;

        return 
    $dirPath ;
    }

    function 
    GetFileExtension$filePath )
    {
        
    $info pathinfo$filePath ) ;
        return 
    $info['extension'] ;
    }

    function 
    CheckUtf8Bom$filePath )
    {
        
    $data file_get_contents$filePath ) ;

        return ( 
    substr$data0) == "\xEF\xBB\xBF" ) ;
    }
    ?>

    </p>
    </body>
    </html>
    Just save it and run it then delete after your finished.
    Peace
    litewarez 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: 5
    Join 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


  2.   Sponsored Links

  3.     
    #2
    mmm 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.

  4.     
    #3
    Member
    Website's:
    *************** IMGscene.com
    Thanks for this!
    He fixed some errors on my site.
    R.I.P Brother ~~ http://www.youtube.com/watch?v=RjPRBPLL6jI

    I'm a standing soldier.... :/

  5.     
    #4
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Join 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


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Music from a dry cleaner
    By Anthonis in forum General Discussion
    Replies: 0
    Last Post: 21st Sep 2011, 07:23 AM
  2. Help! My nfo Cleaner is not really working
    By otti in forum Webmaster Resources
    Replies: 0
    Last Post: 12th Dec 2010, 10:32 AM
  3. Review DDL0v2 - Cleaner, Sleeker & Faster
    By SJshah in forum Site Reviews
    Replies: 32
    Last Post: 30th Jul 2010, 09:26 PM
  4. avast detection
    By koullis in forum Technical Help Desk Support
    Replies: 4
    Last Post: 18th May 2009, 09:24 AM

Tags for this Thread

BE SOCIAL