Jump to content

Unexpected ?(symbol) on page


DeanWhitehouse

Recommended Posts

On this page

http://annaceridwen.com/book/guestbook2.php?action=view&p=2

i there are little ?(symbols) on the page, where there should be icelnadic letters.

 

This the code on the header.

<?PHP
session_start();

$theuser=$_SESSION["valid_user"];

if (!$_SESSION['lang_ice'])
{
$_SESSION['lang_en'] = true;
$_SESSION['lang_ice'] = false;
}

if (isset($_GET['lang']))
{
if ($_GET['lang'] == "en") 
{
$_SESSION['lang_en'] = true;
$_SESSION['lang_ice'] = false;
}
if ($_GET['lang'] == "ice") 
{
$_SESSION['lang_en'] = false;
$_SESSION['lang_ice'] = true;
}
}	

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="grass_stains.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<title>Guestbook</title>
</head>
<body>
<?php
if($_SESSION['lang_ice'] == true)
{
require_once 'ice.php';
}
if($_SESSION['lang_en'] == true)
{
require_once 'en.php';
}
?>
<div class="page_wrap clearfix">
  <div class="header_text">

    <h1>Anna Ceridwen</h1>
  </div>
  <div class="topnav" id="nav"> 
    <ul>
  <li><a href="../index.html"><?php echo $home;?></a></li>
      <li><a href="../Slideshow/index.html"><?php echo $slide; ?></a></li>
  <li><a href="../book/guestbook2.php"><?php echo $guestbook;?></a></li>
      <li><a href="../divx.html"><?php echo $video; ?></a></li>
      <li><a href="../games.php"><?php echo $games; ?></a></li>
     <?
 if (!$_SESSION["valid_user"])
  {
  	echo "<li><a href=\"index.php?action=login\">$login</a></li><li><a href=\"index.php?action=register\">$register</a></li>";
  } else {
	echo "<li><a href=\"profile.php?action=viewprofile\">$welcome $theuser</a></li><li><a href=\"index.php?logout\">$logout</a></li>";
  }
  if ( $theuser == "admin" ) {
   echo "<li><a href='admin.php'>Admin Area</a>";
  }
?>
<li><a href="?lang=en">Eng</a></li><li><a href="?lang=ice">Ice</a></li>
    </ul>
  </div>
  Gestabók
  <div class="container clearfix">
		<DIV ALIGN="center"><FONT SIZE=6 COLOR=black><B><?php echo $guestbook;?></B></FONT><br />

		<a href="./guestbook2.php"><?php echo $sign; ?></a> | <a href="./guestbook2.php?action=view"><?php echo $view;?></a></DIV>
		<HR>

 

as you can see i am using UTF-8 so this shouldnt be happening.

Link to comment
https://forums.phpfreaks.com/topic/110790-unexpected-symbol-on-page/
Share on other sites

Well i have inputted some myself and some if from a database.

 

This is the error that w3 validator gives.

 

 

Sorry, I am unable to validate this document because on line 25  it contained one or more bytes that I cannot interpret as utf-8  (in other words, the bytes found are not valid values in the specified Character Encoding). Please check both the content of the file and the character encoding indication.

The error was: utf8 "\xF3" does not map to Unicode 

 

this is the code

<?PHP
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="grass_stains.css" media="screen" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<title>Guestbook</title>
</head>
<?php
$theuser=$_SESSION["valid_user"];

if (!$_SESSION['lang_ice'])
{
$_SESSION['lang_en'] = true;
$_SESSION['lang_ice'] = false;
}

if (isset($_GET['lang']))
{
if ($_GET['lang'] == "en") 
{
$_SESSION['lang_en'] = true;
$_SESSION['lang_ice'] = false;
}
if ($_GET['lang'] == "ice") 
{
$_SESSION['lang_en'] = false;
$_SESSION['lang_ice'] = true;
}
}	
?>
<body>
<?php
if($_SESSION['lang_ice'] == true)
{
require_once 'ice.php';
}
if($_SESSION['lang_en'] == true)
{
require_once 'en.php';
}
?>
<div class="page_wrap clearfix">
  <div class="header_text">

    <h1>Anna Ceridwen</h1>
  </div>
  <div class="topnav" id="nav"> 
    <ul>
  <li><a href="../index.html"><?php echo $home;?></a></li>
      <li><a href="../Slideshow/index.html"><?php echo $slide; ?></a></li>
  <li><a href="../book/guestbook2.php"><?php echo $guestbook;?></a></li>
      <li><a href="../divx.html"><?php echo $video; ?></a></li>
      <li><a href="../games.php"><?php echo $games; ?></a></li>
     <?
 if (!$_SESSION["valid_user"])
  {
  	echo "<li><a href=\"index.php?action=login\">$login</a></li><li><a href=\"index.php?action=register\">$register</a></li>";
  } else {
	echo "<li><a href=\"profile.php?action=viewprofile\">$welcome $theuser</a></li><li><a href=\"index.php?logout\">$logout</a></li>";
  }
  if ( $theuser == "admin" ) {
   echo "<li><a href='admin.php'>Admin Area</a>";
  }
?>
<li><a href="?lang=en">Eng</a></li><li><a href="?lang=ice">Ice</a></li>
    </ul>
  </div>
  Gestabók
  <div class="container clearfix">
		<DIV ALIGN="center"><FONT SIZE=6 COLOR=black><B><?php echo $guestbook;?></B></FONT><br />

		<a href="./guestbook2.php"><?php echo $sign; ?></a> | <a href="./guestbook2.php?action=view"><?php echo $view;?></a></DIV>
		<HR>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.