# XML Guestbook with PHP

**URL:** <https://forum.kirupa.com/t/xml-guestbook-with-php/116956>\
**Category:** Uncategorized\
**Created:** [July 22, 2004, 7:35pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956 "2004-07-22T19:35:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ofi](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@ofi](https://forum.kirupa.com/u/ofi)\
**Post date:** [July 22, 2004, 7:35pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/1 "2004-07-22T19:35:34Z")

</div>

Hi  
I have uploded the files, but i am not sure how to make it work.  
[http://www.koddinn.com/xml\_guestbook/](http://www.koddinn.com/xml_guestbook/)

I have read thru this [http://www.kirupa.com/web/xml\_guestbook2.htm](http://www.kirupa.com/web/xml_guestbook2.htm)  
without of luck, i am new in this flash, can someone help here, am i doing something wrong ??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2004, 4:26pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/2 "2004-07-23T16:26:18Z")

</div>

You’ve uploaded the FLA but not the HTML and SWF files, so first publish your movie and upload those.  
Then make sure that the permissions on the XML file are sety properly so it can be written to.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2004, 9:41pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/3 "2004-07-23T21:41:53Z")

</div>

Hi

I have publish this now, but when i write in the book, it wont show.  
[http://www.koddinn.com/xml\_guestbook/guestbook.html](http://www.koddinn.com/xml_guestbook/guestbook.html)

The permission on the XML file is CHMOD 777  
Has i forgot something?

---

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [July 25, 2004, 11:34am UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/4 "2004-07-25T11:34:20Z")

</div>

If you look at the third page of the tut you’ll see that the XML file you start with should look like this:

```php

<?xml version="1.0"?>
<guestbook>
</guestbook>

```

yours seems to be totally empty.

---

<div class="post-metadata">

**Author:** ![ofi](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@ofi](https://forum.kirupa.com/u/ofi)\
**Post date:** [July 25, 2004, 12:50pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/5 "2004-07-25T12:50:21Z")

</div>

Hi  
now it work fine, just one thing, does everyone who write the book have to refresh to see the message, does it not autorefresh or…

thx

---

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [July 25, 2004, 5:11pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/6 "2004-07-25T17:11:04Z")

</div>

if you click on “Add a message” you should see your message directly without having to refresh the page.

---

<div class="post-metadata">

**Author:** ![ofi](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@ofi](https://forum.kirupa.com/u/ofi)\
**Post date:** [July 25, 2004, 6:55pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/7 "2004-07-25T18:55:51Z")

</div>

it dont do that, i have to refresh the page to see the message,

test it  
[http://www.koddinn.com/xml\_guestbook/guestbook.html](http://www.koddinn.com/xml_guestbook/guestbook.html)

---

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [July 25, 2004, 8:39pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/8 "2004-07-25T20:39:46Z")

</div>

I see.  
you didn’t by any chance make any changes to the AS or PHP?

---

<div class="post-metadata">

**Author:** ![ofi](https://avatars.discourse-cdn.com/v4/letter/o/df788c/32.png) [@ofi](https://forum.kirupa.com/u/ofi)\
**Post date:** [July 25, 2004, 9:26pm UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/9 "2004-07-25T21:26:23Z")

</div>

I uploaded the orginal php file

\<?php  
$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."  
";  
fclose($file);  
?\>

seems to be working now

thx for this great script

---

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [July 26, 2004, 7:16am UTC](https://forum.kirupa.com/t/xml-guestbook-with-php/116956/10 "2004-07-26T07:16:35Z")

</div>

no problem 🙂
