lukelee Posted November 18, 2008 Share Posted November 18, 2008 I am making a flash form, which include, name, phone, email, radio button,checkbox... when people click submit, I want this form be generated to an xml file through php. I know how to send email through php. but really no idea how to generate an xml through php. can anyone help please? here is the data I collect from flash: $subject = "My Flash site reply"; $name = $_POST["ename"]; $message = $_POST["emessage"]; can anyone please show me how to continue? Quote Link to comment Share on other sites More sharing options...
networkthis Posted November 18, 2008 Share Posted November 18, 2008 You can simply do this using the fwrite command: // This will be your new xml document. $feed = @fopen("new_document.xml",'w'); //This command will write in the new_document.xml //Basically fill in whatever you want in your xml document here..... fwrite($feed,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?><?xml-stylesheet type=\"text/css\" href=\"http://www.yourdomain.com/rss\" ?> \n<rss version=\"2.0\">\n\n"); //This will close the new_document.xml @fclose($feed); Its as easy as 1,2,3 Quote Link to comment Share on other sites More sharing options...
lukelee Posted November 18, 2008 Author Share Posted November 18, 2008 You can simply do this using the fwrite command: // This will be your new xml document. $feed = @fopen("new_document.xml",'w'); //This command will write in the new_document.xml //Basically fill in whatever you want in your xml document here..... fwrite($feed,"<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?><?xml-stylesheet type=\"text/css\" href=\"http://www.yourdomain.com/rss\" ?> \n<rss version=\"2.0\">\n\n"); //This will close the new_document.xml @fclose($feed); Its as easy as 1,2,3 thanks for helps. but what is href=\"http://www.yourdomain.com/rss\ and xml is supposed to be something like: <node> <child> 123 </child> </node> how to i insert those data? Quote Link to comment Share on other sites More sharing options...
lukelee Posted November 18, 2008 Author Share Posted November 18, 2008 I have done it, thanks for help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.