ik krijg rare tekens bij een include

Status
Niet open voor verdere reacties.

phobia

Terugkerende gebruiker
Lid geworden
4 sep 2006
Berichten
1.777
als ik een include doe, dat krijg ik bovenaan mij menu een paar rare tekens te staan.
Code:

Nieuw Wachtwoord : 
Produkt toevoegen : 
Produkt wissen : 
Produkt wijzigen :

de pagina die ik include is de volgende:
PHP:
<?
/* 
starten van van de session
*/
if (isset($_REQUEST['start']))
{
	session_start();
}
$nav = array ();
$Profiel = array();
$Orders = array();
$color = '#C0C0C0';
$i = 0;
if (isset($_SESSION['admin']))
{
	// maken menu array
	$Profiel[] = array ("Nieuw Wachtwoord :","forms/profiel/mainframe.php?id=forms/profiel/new_ww.php','main");
	$Profiel[] = array ("Produkt toevoegen :", "forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main");
	$Profiel[] = array ("Produkt wissen :", "forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main");
	$Profiel[] = array ("Produkt wijzigen :", "forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main");
	$nav[] = $Profiel;
	$array = count($nav[0]);
	$ii = 0;
	$color = 'white';
}
if (isset ($_SESSION['userId'])) 
{
	// maken menu array
	$Profiel[] = array ("Nieuw Wachtwoord :","forms/profiel/mainframe.php?id=forms/profiel/new_ww.php','main");
	$Profiel[] = array ("Wijzig Gegevens :", "forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main");
	$Orders[] = array ("Plaats Bestelling :"," ");
	$Orders[] = array ("Bestellingen :","forms/orders/orders_overzicht.php?order=bestellingen','main");
	$Orders[] = array ("Orders in de Wacht :","forms/orders/orders_overzicht.php?order=wacht','main");
	$Orders[] = array ("Orders Verstuurd :","forms/orders/orders_overzicht.php?order=verstuurd','main");
	$Orders[] = array ("Open Facturen :","forms/orders/orders_overzicht.php?order=factuur','main");
	$nav[] = $Profiel;
	$nav[] = $Orders;

// pagina opmaak request
if (isset($_REQUEST['pag'])){
if ($_REQUEST['pag'] == 1)
{
	$array = count($nav[0]);
	$ii = 0;
}
if ($_REQUEST['pag'] == 2)
{
	$array = count($nav[1]);
	$ii = 1;
}
}
}
// maken tabel menu
echo "<table style='width: 140px' align=\"center\"><tr align=\"center\" >";
while ($i < $array)
{	
echo "<tr><td
		onmouseover = \"javascript:this.style.backgroundColor='#808080';\"
		onmouseout  = \"javascript:this.style.backgroundColor='".$color."';\"
		onclick=\"javascript:link('".$nav[$ii][$i][1]."')\">".$nav[$ii][$i][0]."</td></tr>";
	$i++;
}
echo "</tr></table>";
?>

het gebeurt als $_SESSION['admin'] isset
en de andere SESSION niet en de REQUESTS ook niet.

kan iemand mij vertellen waarom en hoe dit gebeurt!!!

kost mij mijn nacht rust....gnagna
 
Kun je eens proberen om <? te vervangen door <?php

Niet alle servers gaan even goed om met short-tag notatie, en eigenlijk is die ook niet netjes :)
 
Het rare is alleen, dat als ik de php benader via een flash.
Om de andere menu te krijgen, dan krijg ik die rare tekens niet.

en <PHP lost het ook niet op. Of het nou wel of niet netjes staat.
 
Laatst bewerkt:
Hmm. Weet je zeker dat de tekens in de include staan dan? En niet in de file waaruit ze geinclude worden? :/

Ik zie zo niks vreemds aan dit stukje, maar misschien dat ik er over heen kijk.

Kun je eens in de broncode kijken? Staan de rare tekens IN de tabel, of ervoor? (dus voor de <table> ?)
 
Ik heb de pagina al uit gevoerd zonder include. dan is de div helemaal leeg, dus daar zit het niet in. Is zeker een gevolg van de include.

en in de broncode zie ik het ook niet terug.
Code:
<script type="text/javascript">

function getXMLHTTP() { //fuction to return the xml http object
   
    var xmlhttp=false;  
    try {
        xmlhttp=new XMLHttpRequest();
    } catch(e) {        
        try {           
            xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
        } catch(e) {
            try{
                xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            } catch(e1) {
                xmlhttp=false;
            }
        }
    }
            
    return xmlhttp;
}
 
function link(strURL,strDIV) {

  var req = getXMLHTTP(); // fuction to get xmlhttp object

  if (req) {

    req.onreadystatechange = function() {

      if (req.readyState == 4) { //data is retrieved from server

        if (req.status == 200) { // which reprents ok status     
        
          document.getElementById(strDIV).innerHTML=req.responseText;
        } else { 
          alert("There was a problem while using XMLHTTP:\n");
        }
      }            
    }        
    req.open("GET", strURL, true); //open url using get method
    req.send(null);

  }
}

 function getobject(objx)
 {
if (document.getElementById)
return document.getElementById(objx)
else if (document.all)
return document.all[objx]
}

function noenter() {
  return !(window.event && window.event.keyCode == 13); }

</script>

<div id='container' align = 'center' width = '100%' height = '100%'><div id='admin_info' align='right' width='100%'><table><tr><td align='right'>Voornaam : </td><td align='center'>Geert-Jan</td></tr><tr><td align='right'>Achternaam : </td><td align='center'>Gieling</td></tr></table></div><div style='font-size:xx-large;position: absolute;left: 30%; top: 10px'id='header'><h1><strong>Admin Edit Corner</strong></h1></div><div id='nav' width='130' style='backgroundColor= #C0C0C0;position: absolute;left: 5px; top: 50px'><table style='width: 140px' align="center"><tr align="center" ><tr><td
		onmouseover = "javascript:this.style.backgroundColor='#808080';"
		onmouseout  = "javascript:this.style.backgroundColor='white';"
		onclick="javascript:link('../../forms/profiel/mainframe.php?id=forms/profiel/new_ww.php','main')">Nieuw Wachtwoord :</td></tr><tr><td
		onmouseover = "javascript:this.style.backgroundColor='#808080';"
		onmouseout  = "javascript:this.style.backgroundColor='white';"
		onclick="javascript:link('../../forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main')">Produkt toevoegen :</td></tr><tr><td
		onmouseover = "javascript:this.style.backgroundColor='#808080';"
		onmouseout  = "javascript:this.style.backgroundColor='white';"
		onclick="javascript:link('../../forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main')">Produkt wissen :</td></tr><tr><td
		onmouseover = "javascript:this.style.backgroundColor='#808080';"
		onmouseout  = "javascript:this.style.backgroundColor='white';"
		onclick="javascript:link('../../forms/profiel/mainframe.php?id=forms/mainlogged.php?pag=2','main')">Produkt wijzigen :</td></tr></tr></table></div><div id='main' align='center' width='600px' height='100%' style='border-left:thin;border-left-color:silver;border-left-style:dotted;backgroundColor= #C0C0C0;position: absolute;left: 160px; top: 50px'><br><br><br><br><br>main center stage <br>  voor de AJAX aansturing van de frames en iFrames<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div></div>
 
"" is the Byte Order Mark (BOM) of the Unicode Standard. Specifically it is the hex bytes EF BB BF, which form the UTF-8 representation of the BOM, misinterpreted as ISO 8859/1 text instead of UTF-8.

Probably what it means is that you are using a text editor that is saving files in UTF-8 with the BOM, when it should be saving without the BOM. It could be PHP files that have the BOM, in which case they'd appear as literal text on your page.

The Unicode Consortium's FAQ on the Byte Order Mark is at http://www.unicode.org/faq/utf_bom.html#BOM .
heb je daar wat aan?
 
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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

was ik vergeten.....maar nu loopt het joepie super!!!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan