Tuesday, 20 August 2013

PHP include file have extra characters

PHP include file have extra characters

I am using some php/html code to display a navigation bar with
highlighting currently active link.
This is my Code -
<?php
$path = $_SERVER['PHP_SELF'];
$page = basename($path);
$page = basename($path, '.php');
?>
<ul>
<li <?php if ( $page == 'index') echo 'class="current"'; ?>><a
href="index.php">Change Contact Details</a></li>
<li <?php if ( $page == 'change_password') echo 'class="current"';
?>><a href="change_password.php">Change Password</a></li>
<li><a href="change_username.html">Change Username</a></li>
<li><a href="create_blogs.html">Manage Blogs</a></li>
<li><a href="#">Manage Images</a></li>
<li><a href="#">About Your Business</a></li>
<li><a href="#">Be Social</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
When I use this code dirctly in each page its working properly. But when I
use this as include file and trying to import it to my pages. its display
some extra character very before the <ul> list.
Its characters are something like this - 
I checked my pages and I couldn't fine any typed word to like that.
Can anybody tell me what is the reason for this? Thank you.

No comments:

Post a Comment