Ender22 Posted March 31, 2012 Share Posted March 31, 2012 Hello everyone. I'm about to code my new website, but I would love to get an opinion from the more experienced out there on how to go about it first. My website will be PHP MySQL based and have multiple users. The users can play different flash files on the site and the flash content will be different depending on different values that are passed into the flash files. As of now I am passing in xml files to the Flash swf's, and I would love to keep it this way as it works great for what I am doing. My question is... what is the best way to give each one of my users their own xml files. (I need 3-5 xml's for each). Should I try to store the xml inside the mysql database then extract it? Should I create an xml file for each user on my server then just put filename variables into the mysql database? Do I need a content managment system (haven't used one of these before). How would you more experienced coders go about this setup? Any advice is much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/ Share on other sites More sharing options...
gizmola Posted March 31, 2012 Share Posted March 31, 2012 PHP is capable of generating xml files, just as it can generate images, pdf's, javascript and just about any type of data you can think of. Usually people will use a database structure to store the attributes that vary by user, and write some code that renders the customized xml as needed, once a user has logged in. Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1332959 Share on other sites More sharing options...
Ender22 Posted March 31, 2012 Author Share Posted March 31, 2012 Hey thanks for the help, Just to make sure I understand. Usually the variables are stored in the database, then the xml is generated on the fly once the page loads for each user? So if I use php to create an xml file like suggested, where is a good place to store it on the server before passing it into the swf? And what's a good way to make sure it is accessible by that user and just that user? I actually have my flash generating the xml data already because things are saved from within the swf files... I guess I would rather just use the xml that is already being generated either by storing it all into a mysql variable (if that's possible) or just saving and accessing a physical xml file. I really think the easiest thing would be just to have a couple xml files created for each user stored on the server and then just access them by their filename with mysql when they load the swf files... is that a bad idea for any reason? Or is this okay to try? Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1332970 Share on other sites More sharing options...
trq Posted March 31, 2012 Share Posted March 31, 2012 So if I use php to create an xml file like suggested, where is a good place to store it on the server before passing it into the swf? Why do you need to store it? PHP can generate it dynamically and it can be read directly from AS. I actually have my flash generating the xml data already because things are saved from within the swf files... I guess I would rather just use the xml that is already being generated either by storing it all into a mysql variable (if that's possible) or just saving and accessing a physical xml file. XML, As far as a method of data transport is outdated by far superior methods IMO. I really think the easiest thing would be just to have a couple xml files created for each user stored on the server and then just access them by their filename with mysql when they load the swf files... is that a bad idea for any reason? Or is this okay to try? I'm not sure why you think this is the easiest method. If you truly do believe so, why are you here asking questions? Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1332979 Share on other sites More sharing options...
thehippy Posted March 31, 2012 Share Posted March 31, 2012 This sounds like a good place to make a little AMF (Action Message Format) server, Zend_Amf has a good implementation that supports AMF3 which has much better compression options. Server side, this would get rid of the XML generation step as it's a matter of binding a class with RPC-like methods. And be honest Ender does your solution scale very well. Three files per flash file and per user, if you have 100 flash files, when you get 1000 users you have 300000 files floating around, it gets worse as you get more users. Also you're sending all those files to your users, that's a headache in of itself. Read up on AMF to see if it is applicable to your situation. Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1333049 Share on other sites More sharing options...
gizmola Posted April 1, 2012 Share Posted April 1, 2012 Thorpe pretty much summed up my thinking on the matter. thehippy also brought up a technique for passing data that many people use -- amfphp or zend_amf to pass data from the server to your flash movies. Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1333234 Share on other sites More sharing options...
Ender22 Posted April 3, 2012 Author Share Posted April 3, 2012 Thanks for the advice guys... It is only 3 xml files total for each user... but yes it still doesn't scale very well. All of my software is already set up to be used with XML so I think I'll take Thorpe's first suggest and just dynamically generate the xml with php then read it into as3 directly. As far as saving information after the swf is finished... (if i was lazy and didnt want to rewrite everything yet) is it possible to store the entire xml code into a database variable before using php to generate the xml? like the entire <thingGroup> <thing> <value1> </value1> <value2> </value2> </thing> </thingGroup> into mysql? Or will I run into problems? Quote Link to comment https://forums.phpfreaks.com/topic/260057-some-advice-for-starting-my-content-management-please/#findComment-1333892 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.