Note that there are some explanatory texts on larger screens.

plurals
  1. POAnything wrong with this php code?
    text
    copied!<p>1st I have to say I know nothing bout php. I was actually doing my AS3 guest-book and through parts of tutorials from Activetut, I managed to come out a flash guest-book. So the problem now I'm facing is the guest-book could only inject 1 XML data and it will always clear off the old 1, while the flash is still caching on the old XML files.</p> <p>I'd found some other tutorials(which I think its quite hard since i dunno anything about php) and comparing to the php code I'm using, it seems to be extremely short. I have no idea what the code does, so currently I'm not sure whether the problems came from the php or my AS3.</p> <pre><code> &lt;?php if (isset($GLOBALS["HTTP_RAW_POST_DATA"])){ $xml = $GLOBALS["HTTP_RAW_POST_DATA"]; $file = fopen("wish.xml","wb"); fwrite($file, $xml); fclose($file); } ?&gt; </code></pre> <p>and below is my correct XML format:</p> <pre><code>&lt;WISHES&gt; &lt;WISH&gt; &lt;NAME&gt;Test&lt;/NAME&gt; &lt;EMAIL&gt;test@tes.com&lt;/EMAIL&gt; &lt;DATENTIME&gt;2/3/10&lt;/DATENTIME&gt; &lt;MESSAGE&gt;Dummy Message&lt;/MESSAGE&gt; &lt;/WISH&gt; &lt;WISH&gt; &lt;NAME&gt;Test&lt;/NAME&gt; &lt;EMAIL&gt;test@tes.com&lt;/EMAIL&gt; &lt;DATENTIME&gt;2/3/10&lt;/DATENTIME&gt; &lt;MESSAGE&gt;Dummy Message&lt;/MESSAGE&gt; &lt;/WISH&gt; &lt;/WISHES&gt; </code></pre> <p>So anyone kind to explain what that php code does? cause it replace my XML with:</p> <pre><code>&lt;WISH&gt; &lt;NAME&gt;Test&lt;/NAME&gt; &lt;EMAIL&gt;test@tes.com&lt;/EMAIL&gt; &lt;DATENTIME&gt;2/3/10&lt;/DATENTIME&gt; &lt;MESSAGE&gt;Dummy Message&lt;/MESSAGE&gt; &lt;/WISH&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload