Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-24-2009, 08:06 PM   PM User | #1
fatmess
New Coder

 
Join Date: Jan 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
fatmess is an unknown quantity at this point
Parse error:syntax error

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,

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!
fatmess is offline   Reply With Quote
Old 01-26-2009, 04:50 AM   PM User | #2
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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.h...BJECT_OPERATOR

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:44 AM.


Advertisement
Log in to turn off these ads.