The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 10 of 10

Thread: XML guestbook

  1. #1

    XML guestbook

    Hello people..

    I did the tutorial of
    the xml php guestbook here on the kirupa website..

    I changed it a bit and tested it on my own server and that worked fine.
    Now on the website it doesn't.. the guestbook.swf loads externally into a movieclip


    I think that ain't a problem.
    But everytime i wan't to add a message it stops working and get the warning after a while that a flash script isn't working and if i want to end it.
    IS it because of the server from the new website?
    Is it because of XML? I changed the scripts both and i admit i'm not the best add it.
    Here is a link to the original tutorial:
    GuestBook tutorial

    And a link to the website and my Guestbookplease see both to see the difference with adding messages):
    Leo Moreno

    I put my new scripts with it so if someone can help me please do.
    I did not change the php and xml file:
    ThePHP file:
    HTML Code:
    $file = fopen("guestbook.xml", "w+") or die("Can't open XML file");
    $xmlString = $HTTP_RAW_POST_DATA; 
    if(!fwrite($file, $xmlString)){
        print "Error writing to XML-file";
    print $xmlString."\n";
    The XML file:
    HTML Code:
    <?xml version="1.0"?><guestbook><entry myName="Leo Moreno" myURL="" myEmail=""><myText>Welcome on my new website. Please leave a message. </myText></entry></guestbook>
    And my actionscripts:
    HTML Code:
    var currPage = 0;
    var showAmount = 10;
    // set this to the amount of entries you want to view at a time
    previous._visible = false;
    createMessage._visible = true;
    createButton.onRelease = function() {
    	this._visible = false;
    	this._parent.createMessage._visible = true;
    	if (createMessage.nameField.text == "") {
    	} else if (createMessage.emailField.text == "") {
    	} else if (createMessage.urlField.text == "http://") {
    	} else if (createMessage.messageField.text == "") {
    // **** Load XML ****************************
    myXML = new XML();
    myXML.ignoreWhite = true;
    receiverXML = new XML();
    myXML.onLoad = function(success) {
    	myXML.contentType = "text/xml";
    	if (success) {
    	} else {
    		trace("Error loading XML file");
    myIdentifier = Math.round(Math.random()*10000);
    receiverXML.onLoad = function() {
    	this.contentType = "text/xml";
    	_root.currPage = 0;
    createMessage.sendButton.onRelease = function() {
    	var myName = this._parent.nameField.text;
    	var myEmail = this._parent.emailField.text;
    	var myURL = this._parent.urlField.text;
    	var myMessage = this._parent.messageField.text;
    	if (myName == "") {
    		this._parent.errorField.text = "Please fill out your name";
    	} else if (myMessage == "") {
    		this._parent.errorField.text = "Please leave a message";
    	} else {
    		myXML.firstChild.lastChild.attributes.myName = myName;
    		myXML.firstChild.lastChild.attributes.myEmail = myEmail;
    		myXML.firstChild.lastChild.attributes.myURL = myURL;
    		myXML.sendAndLoad("processXML.php", receiverXML);
    		this._parent._visible = true;
    		createButton._visible = true;
    XML.prototype.showXML = function() {
    	myGuestbook.scroll = 1;
    	myGuestbook.htmlText = "";
    	var numItems = this.firstChild.childNodes.length;
    	var firstItem = numItems-(currPage*showAmount);
    	if (currPage == 0) {
    		previous._visible = false;
    	var lastItem = firstItem-showAmount;
    	if (lastItem<=0) {
    		lastItem = 0;
    		next._visible = false;
    	myCount.text = "Total messages: "+numItems;
    	if (firstItem == lastItem+1) {
    		nowShowing.text = "Showing message "+firstItem;
    	} else {
    		nowShowing.text = "Showing message "+firstItem+" - "+(lastItem+1);
    	for (i=(firstItem-1); i>=lastItem; i--) {
    		myGuestbook.htmlText += "Name: "+this.firstChild.childNodes[i].attributes.myName+"\n";
    		myGuestbook.htmlText += "Email: "+this.firstChild.childNodes[i].attributes.myEmail+"\n";
    		myGuestbook.htmlText += "Website: "+this.firstChild.childNodes[i].attributes.myURL+"\n";
    		myGuestbook.htmlText += "Message: "+this.firstChild.childNodes[i].firstChild.firstChild.nodeValue+"\n\n";
    		myGuestbook.htmlText += "-----"+"\n\n";
    previous.onRelease = function() {
    	next._visible = true;
    next.onRelease = function() {
    	previous._visible = true;
    If someone will take the time to help me i'm very thankfull

    Kind regards Jos Koomen
    Hoorn, Netherlands

  2. #2
    I have a major problem with this as well..the same problem you have..try reposting this again
    Last edited by Blenderben; March 19th, 2005 at 03:35 AM.

  3. #3
    i am bumping this thread..someone PLEASE help..i've posted in so many places..No one is helping..comon..

  4. #4
    Maybe we just must load the xml with a preloader because it is the problem of the from the xml guestbook.

  5. #5
    What's the file permission set to for guestbook.xml file???
    CyanBlue / Jason Je / Flash Developer

  6. #6

    what do you mean?

    Quote Originally Posted by CyanBlue
    What's the file permission set to for guestbook.xml file???
    What do you mean with the permission how large it may be or so?


  7. #7
    Hi! CyanBlue was talking about the permissions to read/write the XML file.

  8. #8
    Yeah, I think he means the file permissions as in read, write, and execute as group, owner, or public. (777) Try chmod the file permissions to 777 and see if that helps.

  9. #9
    Does anybody know how to write CDATA nodes into an xml from Flash using PHP ?

  10. #10
    msurgay... That sounds like a good topic to start a new thread rather than hijacking another thread...
    CyanBlue / Jason Je / Flash Developer

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012