I need to write an xml file dynamically. I have looked everywhere for scripts and it appears none of them will work on my server because I have php4. Can someone point me to a script that I can use with php4 and especially how to save that file. I see so much online about load...I want to overwrite the file everytime I click a button and write new information. I don't see how to save an xml file..I see lots of info on how to open an already existing file up. I want to create a xml file dynamically and saving it on my server using PHP. If you could attach sample code that would be great because I am a newbie.
PHP doesn't care what it outputs.
$fh = fopen('file.xml', 'w'); fwrite($fh, '<?xml version="1.0" encoding="UTF-8"?>'); fwrite($fh, '<root>'); ... fwrite($fh, '</root>'); fclose($fh);
I tried that and I get a blank page and no file.xml is created. I also put it in another directory and changed the permissions but no luck. I also tried changing permissions of php file and nothing. I have opened my ftp and changed the permissions to 777 and 755 but nothing. I actually get a 500 error...I read somewhere that hosts do that on purpose...I don't know...what do you suggest?