Jump to content

Recommended Posts

I'm pretty new to php, so I'm not sure if my problem is simple or not, but hopefully someone can help me..

 

I'm working on a website, and I'm using php to make a small template system, to limit the time it takes to maintain the site. My problem is that sometimes when I load the page, I get a weird bunch of symbols at the top-center of the site (weirdtext.jpg).

 

I'm not quite sure what they are, or how I can get rid of them. I just find it odd that they only load some of the time. If I refresh the page, it might go away, it might not ???

 

Here is the code for my index.php:

<?php

// Address Error Handling.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~ E_NOTICE);

// Set Page Title
define ('TITLE', 'Page Title');

require ('Included/top.html'); //Load the top of the page code.

?>

<!--Page Contents-->

<h2>Home</h2>
<br>

<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur elementum velit quis mi. Aenean ullamcorper, sem vel semper ultrices, sem dolor varius tellus, sed tristique velit est iaculis urna. Proin interdum urna quis libero. Ut in odio. Etiam vulputate quam at lectus. Sed suscipit. Sed vitae lorem. Morbi semper, ipsum feugiat mollis auctor, erat sem euismod quam, ac sollicitudin massa arcu ac turpis. Fusce felis sapien, bibendum nec, pretium ac, mattis dictum, ipsum. Nunc non orci. Nam semper semper elit. Nullam vitae arcu. Duis id sem in velit interdum adipiscing. Pellentesque dictum tincidunt pede. Aliquam erat volutpat. Phasellus rutrum. Donec pharetra libero a tellus. Vestibulum diam. Pellentesque molestie placerat mi. Duis pellentesque laoreet nibh.
</p>
<br>

<p>
Donec sit amet enim sodales turpis commodo semper. Pellentesque sed orci. Nullam velit diam, congue eget, ultrices et, interdum eu, nulla. Ut nec felis. Duis eleifend sapien nec sapien. Aenean id orci. Quisque nulla velit, viverra ac, egestas in, condimentum non, dui. Mauris pretium, lorem tincidunt iaculis feugiat, ipsum urna vehicula metus, imperdiet tempor lectus purus facilisis mi. Nam ut augue non erat rutrum vulputate. Quisque volutpat posuere libero. Pellentesque scelerisque, urna nec dignissim blandit, neque felis lobortis nulla, a vehicula sem lectus a nulla. Mauris ut leo et metus dignissim interdum. In hac habitasse platea dictumst. Aenean sit amet magna vitae mi aliquam laoreet. Proin sed libero. Phasellus ut magna id magna consequat congue. Cras tempus. Morbi lobortis, felis vitae tristique feugiat, purus turpis consequat enim, vel viverra ipsum lectus sed orci. Praesent condimentum, ante quis tristique rhoncus, dolor metus porttitor enim, in fringilla leo enim ac lectus. Ut suscipit mollis orci.
</p>
<br>

<!--/Page Contents-->

<?php

require ('Included/bottom.html'); //Load the bottom of the page code.

?>

 

Here is the top.html:

<!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" xml:lang="en" lang="en">
<head>
	<title>
		<?php
			if (defined ('TITLE'))
				{ print TITLE; }
			else
				{ print 'The Broken'; }
		?>
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<meta name="robots" content="noindex, nofollow" />
	<link rel="SHORTCUT ICON" href="/Included/favicon.ico"/>

	<!--Web Stats Script-->
		<script src="/Mint/?js" type="text/javascript"></script>
	<!--/Web Stats Script-->

	<style type='text/css' media='all'>
		@import url( 'Style1.css' );
		@import url( 'Style2.css' );
	</style>

	<style type='text/css'>
		@import url( 'Style3.css' );
	</style>

	<!--[if IE 6]>
		<style type='text/css'>
			@import url( 'Style4.css' );
		</style>
	<![endif]-->
</head>

<body>
	<div id='main_container'>
		<div id='head_menu_container'>
			<div class='_head_menu_bg'></div>

<!--Search Box-->
<div id='site_search'>
	<form id="searchbox_003857263146498806944:jkwuw2zfm7i" action="#">
		<input type="hidden" name="cx" value="003857263146498806944:jkwuw2zfm7i" />
		<input type="hidden" name="cof" value="FORID:11" />
		<input class='off' type='text' size='15' name='q' value='Search...' onfocus="if(this.value=='Search...'){this.value='';this.className='on'}" onblur="if(this.value==''){this.value='Search...';this.className='off'}" />
		<input type='submit' value='Go' name='sa' class='submit' />
	</form>
</div>
<!--/Search Box-->

			<ul>
				<!--
					To set a list item as selected, add:
						id='li_corp' 
					to the list item. Only one must be selected.
				-->
				<li id='li_corp'><a href="#" title='Link'>Link</a></li>
				<li><a href="#" title='Link'>Link</a></li>
				<li><a href="#" title='Link'>Link</a></li>
				<li><a href="#" title='Link'>Link</a></li>
				<li><a href='#' title='Link'>Link</a></li>
				<li><a href="#" title='Link'>Link</a></li>
			</ul>

<!--Top Menu Script-->
			<script type='text/javascript' src="Included/Script.js"></script>
<!--/Top Menu Script-->

		</div>

		<div id='header'>
			<h1>Site Header</h1>
		</div>

		<div id='body_container'>
			<div id='menu'>

<!--Left Menu-->
<ul>
	<li class='selected'>
		<a href="#" title="">Link</a>
		<ul>
				<li class='selected'>Link</li>
				<li>
					<a href="#" title="">Link</a>
				</li>
				<li>
					<a href="#" title="">Link</a>
				</li>
				<li>
					<a href="#" title="">Link</a>
				</li>
		</ul>
	</li>
	<li>
		<a href="#" title="">Link</a>
		<!--
		<ul>
		</ul>
		-->
	</li>
	<li>
		<a href="#" title="">Link</a>
		<!--
		<ul>
		</ul>
		-->
	</li>
</ul>
<!--/Left Menu-->

<br /><br />

<!--Text Box-->					
	<div class='side_box'>
		<h5>Users Online:</h5>
			<p>Text Goes Here</p>
	</div>
<!--/Text Box-->

	<br />	
			</div>
			<div id='body'>

			<!--Breadcrumb-->
				<div class='breadcrumb'><a href='#' title='Link'>Link</a> > Link</div>
			<!--/Breadcrumb-->

				<div class='content_main'>
<!--Changeable Content-->

 

Here is the bottom.html:

<!--/Changeable Content-->

				</div>				
			</div>
		</div>

		<span class='_clear'></span>

		<div id='footer_container'>
			<ul>
				<li><a href='/Forum/' title='Forum'>Forum</a> |</li>
				<li><a href='/Mint/' title='Site Stats'>Site Stats</a> |</li>
				<li><a href='/Store/' title='Store'>Store</a> |</li>
				<li><a href='#' title='Link'>Link</a></li>
				<li>              </li>
				<!--Validation Icons-->
					<li><a href="http://validator.w3.org/check?uri=referer"><img src="Images/xhtml.png" alt="XHTML Valid" /></a></li>
					<li><a href="http://jigsaw.w3.org/css-validator/"><img src="Images/css.png" alt="CSS Valid" /></a></li>
					<li><a href="http://www.mozilla.com/en-US/firefox/"><img src="Images/firefox.png" alt="Firefox" /></a></li>
				<!--/Validation Icon-->
			</ul>

			<!--Copyright-->
				<span class='copyright'>© 2008 The Broken</span>
			<!--/Copyright-->

			<span class='_clear'></span>
		</div>
	</div>

</body>

</html>

 

Thanks in advance :)

Link to comment
https://forums.phpfreaks.com/topic/146692-remove-bom-from-top-of-page/
Share on other sites

In Notepad++, you can save your files as UTF-8 without BOM. Or you can edit it out in a HEX editor. I always avoid the BOM, as it will only cause you problems. Also, the Unicode standard doesn't recommend using it with UTF-8. Check out its Wikipedia page if you want.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.