Vraag & Antwoord

Webprogrammeren & scripting

Parse error, unexpected T_STRING

4 antwoorden
  • Als ik naar dit adres gaat: [url]http://www.webmedia-international.com/~~test/test.php?pagina=menu-cz-01[/url] Dan krijg ik deze fout [quote:6f5caaae7d="[De fout melding]"]Parse error: parse error, unexpected T_STRING in /www/htdocs/webmed/~~test/template/menu-cz-01.htm on line 1[/quote:6f5caaae7d] Maar als ik direct daar dat bestand gaat, dan gaat het wel goed :/ [url]http://www.webmedia-international.com/~~test/template/menu-cz-01.htm[/url] Wat kan dit zijn ??
  • een unexpected t-string melding duidt meestal op een lullige ; die vergeten is. Maar is dit een site die jij aan het ontwikkelen bent? t.
  • Ja :wink: Mooie taal, niet ?? Dat is dus mijn moeder taal. Dit is trouwens de bron Dit is de PHP pagina. [code:1:b70d1ef75e]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Restaurace Na Jizni</title> <meta http-equiv=Content-Type content="text/html; charset=windows-1250"> <SCRIPT language=javascript src="script/mouse-over.js" type=text/javascript></SCRIPT> <link href="css/x9bb53tt.css" rel="stylesheet" type="text/css"> <link href="css/x9bb53tt.css" rel="stylesheet" type="text/css"> </head> <body onresize=OnResize() onload=CheckDiv();MM_preloadImages('../images/home_1.gif')> <div id=content style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; Z-INDEX: 1; overflow:auto; LEFT: 147px; BORDER-LEFT: #000000 1px; WIDTH: 477px; BOTTOM: 0px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 0px; HEIGHT: 100%; BACKGROUND-COLOR: #ffffff; layer-background-color: #FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/spacer.gif" width="10" height="57"></td> </tr> <tr> <td> <?php if(isset($_GET["pagina"])) { include("template/" . $_GET["pagina"] . ".htm"); } else { include ("template/start-cz.htm"); } ?> </td> </tr> </table> </div> <div id=right style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; Z-INDEX: 3; LEFT: 624px; BORDER-LEFT: #000000 1px solid; WIDTH: 147px; BORDER-BOTTOM: #000000 1px solid; POSITION: absolute; TOP: 57px; HEIGHT: 100%;"> <table width="100%" border="0" cellpadding="0" cellspacing="4"> <tr> <td><span class="Head">Jídelní lístek</span></td> </tr> <tr> <td>&</td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-01" class="navleft">Snídaně, Polévky</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-02" class="navleft">Teplé předkrmy</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-03" class="navleft">Něco na zub</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-04" class="navleft">Pro štíhlou linii</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-05" class="navleft">Rybí speciality</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-06" class="navleft">Specialita kuchařů</a></td> </tr> <tr> <td><a href="content-cz.php?pagina=menu-cz-07" class="navleft">STEAKY Masa na roštu</a> </tr> <tr> <td><a href="test.php?pagina=menu-cz-08" class="navleft">Minutky z masa</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-09" class="navleft">Bezmasá jídla</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-10" class="navleft">Saláty a Studené předkrmy</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-11" class="navleft">Moučníky, Poháry</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-12" class="navleft">Omáčky, Přílohy</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-13" class="navleft">Nápoje</a></td> </tr> <tr> <td><a href="test.php?pagina=menu-cz-14" class="navleft">Doplňkový prodej</a></td> </tr> </table> </div> </body> </html>[/code:1:b70d1ef75e] En dit is de pagina die ge-parse wordt [code:1:b70d1ef75e]<?xml version="1.0" encoding="windows-1250"?><!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 name="generator" content="-" /> <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" /> <link href="../css/x9bb53tt.css" rel="stylesheet" type="text/css" /> <title></title> </head> <body> <XML ID="a" SRC="xml/menu-01a.xml"></XML> <XML ID="b" SRC="xml/menu-01b.xml"></XML> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="../images/spacer.gif" width="26" height="102" /></td> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="Head">Snídanì</td> <td width="150"><div align="right"><img src="images/jidelnicek_20web2_6157_image002.gif" /></div></td> </tr> </table></td> <td>&</td> </tr> <tr> <td><img src="../images/spacer.gif" width="26" height="21" /></td> <td><img src="../images/spacer.gif" width="45" height="21" /></td> <td><img src="../images/spacer.gif" width="320" height="21" /></td> <td><img src="../images/spacer.gif" width="66" height="21" /></td> </tr> </table> <XML SRC="xml/menu-01a.xml"></XML> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0" datapagesize="100" id="Table" datasrc="#a"> <tr align="center" class="navleft"> <td width="26" height="21"><div align="left"><span datafld="menukaart-nr"></span></div></td> <td width="45" height="21"><div align="left"><span datafld="eenheid-cz"></span></div></td> <td width="320" height="21"><div align="left"><span datafld="tekst-cz"></span></div></td> <td width="33" height="21"><div align="left"><span datafld="kc"></span></div></td> <td width="33" height="21"><div align="right"><span datafld="prijs"></span></div></td> </tr> </table> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><img src="../images/spacer.gif" width="26" height="102" /></td> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="Head">Polévky</td> <td width="150"><div align="right"><img src="images/jidelnicek_20web2_6157_image006.gif" /></div></td> </tr> </table></td> <td>&</td> </tr> <tr> <td><img src="../images/spacer.gif" width="26" height="21" /></td> <td><img src="../images/spacer.gif" width="45" height="21" /></td> <td><img src="../images/spacer.gif" width="320" height="21" /></td> <td><img src="../images/spacer.gif" width="66" height="21" /></td> </tr> </table> <XML SRC="xml/menu-01b.xml"></XML> <table width="450" border="0" align="center" cellpadding="0" cellspacing="0" datapagesize="100" id="Table" datasrc="#b"> <tr align="center" class="navleft"> <td width="26" height="21"><div align="left"><span datafld="menukaart-nr"></span></div></td> <td width="45" height="21"><div align="left"><span datafld="eenheid-cz"></span></div></td> <td width="320" height="21"><div align="left"><span datafld="tekst-cz"></span></div></td> <td width="33" height="21"><div align="left"><span datafld="kc"></span></div></td> <td width="33" height="21"><div align="right"><span datafld="prijs"></span></div></td> </tr> </table> </body> </html>[/code:1:b70d1ef75e]
  • Als ik het dus goed begrijp include je een html pagina? Dat zal niet werken aangezien include(...) de code als PHP code include natuurlijk. En aangezien de pagina die jij probeert te includen niet echt op PHP code lijkt, krijg je errors ;) Oplossing: in de templates <?php echo ' .... '; ?> of zo zetten (waarbij .... je lap HTML/XML is).

Beantwoord deze vraag

Weet jij het antwoord op deze vraag? Registreer of meld je aan met je account

Dit is een gearchiveerde pagina. Antwoorden is niet meer mogelijk.