PHP 5.3.3 - Appending Well Formed XML Data - Wordpress Solution
[Solved] - PHP 5.3.3 - Appending Well Formed XML Data - Wordpress Solution |
---|
Try following codes |
Hello,
I am needing assistance with a PHP Script and I can not figure out how to finish it.
I have a script that gets fired off from a Flash Application about every 5 minutes upon completion of a specific event.
The PHP script generates 20 random numbers that gets saved to 2 different files. 1 file gets overwritten each time the script is run and the other get appended to the current data.
The format of the data file must be XML. I have a working script that generates 1 set of this data but I can not get the proper format on the appending of the data. It becomes malformed and the flash application errors out.
The script behavior is very simple.
If this data file does not exist, then the file gets created. The game number simply starts at 1 and then increments by 1 each time the script is run.
The number nodes are populated by a random sequence that can not have any duplicates. The range of numbers are from 1 to 80 where only 20 numbers get selected.
Below is an example of multiple calls to the script.
The XML data must be well formed using DOM classes. I believe my actionscript uses DOM standards as well so to stay solid, DOM in PHP should be used.
Thanks. I look forward to a resolution for this project!
The format that I need is as follows. This would be 3 instances that the script was run.
Here is my code that generated the first data set.
Solution - 1You have to change the append part to something like this:
|
Date: 2022-10-21 05:21:15 |
Category: Wordpress |