PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
So, it should genereate a file called 'noticia.xml', which would be read by a flash. But it doesn't.
Strangely, I renamed this noticia.xml file through a FTP client and the flash cotinues to show the info contained within it. Anyway, why isn't the code above rewriting 'noticia.xml'?
Be sure that you're looking at the correct file, in the correct folder as well. Are you sure it's noticia.xml that is in the folder "../../" (i.e. two folders up) ?
Do you suppress PHP errors? Perhaps the file has an invalid CHMOD value.
I assume you checked the file's contents manually and not just looked at the Flash file? Since maybe cache would be an influence here, but I doubt that it's the case.
This code is in a function. Are you sure that this function is being run?
Checked. Correct file. Correct folder.
Hm... How and why am I supposed to do that? Also, exactly which file/folder should I check the CHMOD?
Yes, I did.
No, the function is being run. I added an alert just to be sure.
Below's the modified code. I added your "if" plus one mine. The fwrite fails to write the file. The question is: why? I have already changed the CHMOD to 755 and 777 but the problem persists. Any idea? Oh, btw, your "if" echos "File is not writable. Please use a higher CHMOD value!".
Not really relevant to your question, but I'd recommend SimpleXML if you have it, or DOMXML to build your XML file, rather than explicitly typing the characters out.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.