|
|||
|
Hey all,
I've been working for hours trying to get this to work and can not figure out whats going on. I'm simply trying to use the server API to add a new room. I have an Apache webserver running flashChat on the same box. I can connect to flash chat fine for chatting. I'll cut and paste the code from here http://www.123flashchat.com/addroom-serverapi.html and it doesn't work. I keep getting this error : "XML error: no element found at line 1 while parsing entity n" I have the following in the default.xml <server-api enable="On"> <auth-password>3874-3459-9293-2194</auth-password> <allow-access-from-ip>127.0.0.1</allow-access-from-ip> </server-api> this is flashchat version 5.1 Can anyone think of anything else I should be checking? or have any idea what might be happening? thanks. |
|
|||
|
Joy is correct:
you don't necessarily need the full version to test server API, demo version is fine too. again,please confirm your php version is higher than 4.2.0 or greater,this error occurs in PHP 4.1.x. if it still can't help you to solve this problem,if possible,you could offer ssh account to us so that we could check what the problem is |
|
|||
|
Ok, I may try to set something like that up. I have tried this on two different machines, both windows, both Apache. One is PHP 4.3 and the other php 5. I've pretty much just copy and pasted the sample code for add_room and executed that with no success.
I've double checked the auth pass and made sure the server API is on, etc. Feel like I've double checked everything and seems like it should work. I may try to get a ssh server up for you if I can't get this solved in the next week or so. Thanks for the help. |
|
|||
|
SUCCESS!!!!
Finally got this to work. Quick summary... I've only simply copied the example code from here http://www.123flashchat.com/addroom-serverapi.html Didn't work. I read this little note from the User manual for server api xml strings: "Note: Remember to terminate XML-commands with a null-byte." and I assumed thats what this line was doing, from the example code: fputs($fp,$apiCommand.""); anyhow it wasn't working.. I removed the ."" from the line above, and added a .chr(0) to the end of the xml string like this: $apiCommand = '<?xml version="1.0" encoding="UTF-8"?><Command group="default" api_pwd="3874-3459-9293-2194" type="add_room" name="test room" owner="admin" desc="room for test" max="200" />'.chr(0); and it works... I suppose I could have replaced the ."" with a chr(0) like so: fputs($fp,$apiCommand.chr(0)); but thats not how I tested it.. would prolly work though.. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|