Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Sep 2012
    Posts
    110
    Thanks
    29
    Thanked 0 Times in 0 Posts

    Question How do I hide byte code markers ()from my webpages?

    How do I hide byte code markers ()from my webpages?

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    You don't. You remove them from the underlying file that's storing the bom in the first place.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    it looks like an issue with encoding.
    maybe you are serving documents encoded in utf-8 as iso...
    but that's just a guess. post more details
    Last edited by patryk; 03-22-2013 at 06:58 PM.

  • #4
    Regular Coder
    Join Date
    Sep 2012
    Posts
    110
    Thanks
    29
    Thanked 0 Times in 0 Posts
    Patryk, here is the HTML code of the webpage:

    Code:
    <?PHP
    header('Content-type: text/html; charset=latin1_general_ci');
    ?>
    
    <html>
    <head>
    
    <title>Diary Polly</title>
    
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    
    <script type='text/javascript'></script>
    
    
    <meta name="generator" content="WordPress 3.4.2" />
    
    <!-- Clean Archives Reloaded v3.1.10 | http://www.viper007bond.com/wordpress-plugins/clean-archives-reloaded/ -->
    <style type="text/css">.car-collapse .car-yearmonth { cursor: s-resize; } </style>
    <script type="text/javascript">
    /* <![CDATA[ */
    jQuery(document).ready(function() {
    jQuery('.car-collapse').find('.car-monthlisting').hide();
    jQuery('.car-collapse').find('.car-monthlisting:first').show();
    jQuery('.car-collapse').find('.car-yearmonth').click(function() {
    jQuery(this).next('ul').slideToggle('fast');
    });
    jQuery('.car-collapse').find('.car-toggler').click(function() {
    if ( 'Expand All' == jQuery(this).text() ) {
    jQuery(this).parent('.car-container').find('.car-monthlisting').show();
    jQuery(this).text('Collapse All');
    }
    else {
    jQuery(this).parent('.car-container').find('.car-monthlisting').hide();
    jQuery(this).text('Expand All');
    }
    return false;
    });
    });
    /* ]]> */
    </script>
    
    </head>
    <body><div id="container">
    <div id="search">
    <form method="post" action="search.php?go" id="searchform">
    <input type="text" name="name">
    <input type="submit" name="submit" value="Find it >>">
    </form>
    </div>
    <div id="menu-holder"><ul id="menu">
    <li id="archives"><a href="archives.php"></a></li>
    <li id="subscribe"><a href="subscribe.php"></a></li>
    <li id="about_me"><a href="about_me.php"></a></li>
    </ul>
    </div>
    <div id="title">
    <h2><a href="./**** and Bull Stories_files/**** and Bull Stories.htm"></a></h2>
    </div>
    </div>
    <div id="content">
    <div class="col01">
    <div class="post" id="post-1479">
    <h3>
    <?php
    header('Content-type: text/html; charset=latin1_general_ci');
    
    
    // Include database connection settings
    include('config.inc');
    
    //first select the post based on $_GET['Index']
    
    $Index = $_GET['Index'];
    $sql = "SELECT * FROM `entries` WHERE `Index` ='$Index' ";
    
    $result = mysql_query($sql) or die(mysql_error());
    
    
    
    
    //display post title
    while($row = mysql_fetch_assoc($result))
    {
    echo '' . $row['Title'] . '<br>';
    
    }
    
    ?>
    </h3>
    <div class="post-inner">
    <div class="date-tab"><span class="month">
    <?php
    
    
    
    // Include database connection settings
    include('config.inc');
    
    //first select the post based on $_GET['Index']
    
    $Index = $_GET['Index'];
    $sql = "SELECT * FROM `entries` WHERE `Index` ='$Index' ";
    
    $result = mysql_query($sql) or die(mysql_error());
    
    
    
    
    //display story data
    while($row = mysql_fetch_assoc($result))
    {
    echo '' . $row['Date'] . '<br>';
    
    }
    
    ?>
    </span><span class="day"></span></div>
    <div class="thumbnail"></div>
    <?php
    
    
    
    // Include database connection settings
    include('config.inc');
    
    //first select the post based on $_GET['Index']
    
    $Index = $_GET['Index'];
    $sql = "SELECT * FROM `entries` WHERE `Index` ='$Index' ";
    
    
    $result = mysql_query($sql) or die(mysql_error());
    
    
    //display story data
    while($row = mysql_fetch_assoc($result))
    {
    header('Content-type: text/html; charset=latin1_general_ci');
    echo '<img src = "' . $row['Photo_link'] . '" width="425" height="320" alt = "" /><br><br>';
    echo ' ' . nl2br($row['Post']) . '<br>';
    
    
    }
    
    
    
    ?>
    
    </div>
    
    </div>
    
    
    
    
    
    <div class="post-nav"><span class="previous"></span><span class="next"></span></div>
    </div>
    <div class="col02">
    <div class="recent-posts">
    <ul>
    <li>
    <?php
    
    // Include database connection settings
    include('config.inc');
    
    $result = mysql_query("SELECT * FROM entries order by Date DESC limit 0,8");
    
    while($row = mysql_fetch_assoc($result))
    {
    $Index=$row['Index'];
    echo '<a href="selected_post.php?Index='.$Index.'">' .$row['Title'] . '</a>';
    echo ' ' . $row['Date'] . '';
    
    }
    
    
    ?>
    <br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    <ul>
    <li><br>
    <span class="listMeta"></span></a></li>
    </ul>
    </div>
    <div class="postit-bottom"></div>
    <div class="categories-upper"></div>
    <div class="categories">
    <ul>
    
    <li></li>
    <li></li>
    <li></li>
    
    </ul>
    
    </div>
    <div class="categories-btm"></div>
    
    <div class="side-meta">
    <ul>
    <li>
    <a href="http://ngishili.com/wp-login.php"></a> </li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"> <abbr title="eXtensible HyperText Markup Language"></abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network"></abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform."></a></li>
    </ul>
    </div> </div>
    <br clear="all">
    </div>
    <div id="footer-holder">
    <div class="footer"></div>
    <div class="txt"> <p> <strong>Name:</strong> Thuita J. Maina<br>
    <strong>Nationality:</strong> Kenyan <br>
    <strong>Location:</strong> Kiserian, Rift Valley, Kenya<br>
    <strong>Says:</strong> I always try to remind myself of how special I am.</p>
    <p> <a href="contact.php" target="_blank"><strong>Click Here To Contact
    Thuita</strong></a> </p>
    </div>
    <span class="smashing"><a href="http://jobs.smashingmagazine.com/">Smashing Magazine</a></span> <span class="rss"><a href="http://ngishili.com/?feed=rss2">RSS</a></span></div>
    </body>
    </html>

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This charset isn't correct. Set your header as header('Content-type: text/html; charset=utf-8');. Pretty sure we've covered that a few times now in your other thread.
    Byte order markers cannot be removed this way. They precede the file and that header will *not* work until you've corrected the BOM (or are using ini/perdir set output buffering). You need to open this script in a basic text editor and save it in ANSI NOT in unicode. If you need unicode, you can use notepad++ to save it in unicode without BOM.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •