Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

HFJS ,chapter 12 -fatal error

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I cant find an explanation as to why the blog.xml file is not getting updated.When i give an entry in youcubeadd.html and click on the button(Add the new blog entry) it throws the alert message saying-a new blog successfully added but the problem is the blog.xml file is not getting updated.I tried all sorts of things but failed to solve the problem.
In addition, addblogentry.php is showing this error

Fatal error: Call to undefined method SimpleXMLElement::addChild() in C:\Program Files\Apache Group\Apache2\htdocs\chapter12\youcube\addblogentry.php

The code for addblogentry.php is as follows:




....and blog.xml


Do i need to install xml parser in order to this example or my browser is not supportive?
[ June 03, 2008: Message edited by: panindra nath ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of php are you running? I think you need to be running 5.13 for it to run.

Eric
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
 
panindra nath
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

I am currently using PHP 5.0.3.But using this version i was able to run all the examples given in HEAD RUSH AJAX as it contains some examples that uses XML.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by panindra nath:
Hi Eric,

I am currently using PHP 5.0.3.But using this version i was able to run all the examples given in HEAD RUSH AJAX as it contains some examples that uses XML.



But were the other examples using the addChild? Probably not.

You can see the documentation here which specifies the version required: http://php.net/manual/en/function.simplexml-element-addChild.php

Eric
 
panindra nath
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,

I found out that older versions of PHP cannot be used to modify (add or delete) the contents of a XML file.As you said in your reply i installed PHP 5.3 and the example worked.

THANK YOU
 
Well THAT's new! Comfort me, reliable tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic