Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Code: Select all
$book=array();
$article=0;
.....
function startElement($parser,$name,$attr){
$GLOBALS['currentElement']=$name;
switch($name)
{
case 'author':
$author=0;
break;
}
}
function endElement($parser,$name){
global $article;
switch($name){
case 'article':
$article++;
break;
}
}//end endElement()
/* The character data Handler. Depending on what the currentElement is, the handler assigns the value to the appropriate variable */
function characterData($parser, $data) {
global $article,$book;
switch($GLOBALS["currentElement"])
{
case 'title':
$book[$article]['title'].=$data;
break;
case 'abstract':
$book[$article]['abstract'] .= $data;
break;
case 'keyword':
$book[$article]['keyword'] .= $data;
break;
}
}Notice: Undefined offset: 0 in c:\Inetpub\wwwroot\localhost\showxml.php on line 55
Notice: Undefined index: title in c:\Inetpub\wwwroot\localhost\showxml.php on line 55
Notice: Undefined index: abstract in c:\Inetpub\wwwroot\localhost\showxml.php on line 67
Notice: Undefined index: keyword in c:\Inetpub\wwwroot\localhost\showxml.php on line 70
Notice: Undefined offset: 0 in c:\Inetpub\wwwroot\localhost\showxml.php on line 58
why??
pls pls pls
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]