<?
if (!isset($_SESSION)){
session_start();
ob_start();
}
?>
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<?
include("conexao.php");
$tipo_produto = "notebooks";
$sql = "select * from cadas_produtos where tipo_produto = '" .$tipo_produto. "'order by estado";
$res = mysql_query("$sql");
$row = mysql_fetch_array($res);
$_docxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
$_resp = $_docxml->createElement('titulo');
$_resp = $_docxml->appendChild($_resp);
$_titulo = $_docxml->CreateTextNode($row[titulo_produto]);
$_titulo = $_resp->appendChild($_titulo);
header('Content-type: application/xml');
echo $_docxml->saveXML();
?>
</BODY>
</HTML>
o browser informa o erro
Parse error: syntax error, unexpected $end in /home/negocios/public_html/dam/mercadolivre/computadores/teste.php on line 40
A linha 40 é o fechamento da tag </html>

O Que Ha De Errado Com Este Xml
Started By halfar, 11/04/2010, 11:40
Nenhuma resposta neste tópico
#1
Posted 11/04/2010, 11:40
fiz um codigo utilizando xml com php. ao executar o programa, o browser informa um erro na ultima linha do codigo, ou seja, apos fechar a tag </html>. O codigo é bem simples, veja abaixo
1 user(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)