...

View Full Version : Parse error:syntax error



fatmess
01-24-2009, 08:06 PM
Hi,
beginner question,
I get the following error,
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in bla bla bla on line 6

when I run the following W3schools code,


<?php
$q=$_GET["q"];$xmlDoc = new DOMDocument();
$xmlDoc->load("cd_catalog.xml");$x=$xmlDoc->getElementsByTagName('ARTIST');for ($i=0; $i<=$x->length-1; $i++)
{
//Process only element nodes
if ($x->item($i)->nodeType==1)
{
if ($x->item($i)->childNodes->item(0)->nodeValue == $q)
{
$y=($x->item($i)->parentNode);
}
}
}$cd=($y->childNodes);for ($i=0;$i<$cd->length;$i++)
{
//Process only element nodes
if ($cd->item($i)->nodeType==1)
{
echo($cd->item($i)->nodeName);
echo(": ");
echo($cd->item($i)->childNodes->item(0)->nodeValue);
echo("<br />");
}
}
?>


Thanks for any help in resolving this!

A1ien51
01-26-2009, 04:50 AM
This really has nothing to do with Ajax, should have been asked in the php forum.

Have you searched the forum? http://www.codingforums.com/result.htm?cx=partner-pub-3356683755662088%3Ai21tla-3q3e&cof=FORID%3A9&ie=ISO-8859-1&q=unexpected+T_OBJECT_OPERATOR

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum