zuperxtreme Posted August 19, 2009 Share Posted August 19, 2009 I need an answer quick. I have to make a PHP function/app that when the user uploads "x" file it needs to create a new website. For example youtube. You upload a video and it creates a new unique URL for that video: watch?v=aBZsy6TDg4A ,for example. I need to do something like that. I need to upload images, generate XML of those uploaded and then run another piece of code on that XML. It creates 2 XML's and then Flash takes those XML's and loads them. All of that(well except the uploading part) is done. I need to generate a new random directory and a URL linking to that. Say directory name: xdFe43 , then the URL linking to that should be www.mywebsite.com/myNewDirectory?=xdFe43 Would that need anything else than just PHP? I'm trying to keep it as simple as possible ... Quote Link to comment Share on other sites More sharing options...
gevans Posted August 20, 2009 Share Posted August 20, 2009 I need an answer quick. Not the best introduction... Quote Link to comment Share on other sites More sharing options...
Monadoxin Posted August 20, 2009 Share Posted August 20, 2009 PHP can do this. One way of accomplishing this is to store the xml info and the file into a table, which is not a very fun thing, but fast to do what you want. Then you wouldn't need to create directories, etc.. You would just go to like: index.php?file=somenumberorstring then it would show what you want. You could also get into the mess of creating directories and uploading the files to that directory. For that I would recommend a main directory for these new ones to go it or it will get messy in your web folder. Create a directory called 'data' or whatever, then in php when the user submits the file you need to create a new directory inside data and move all the files into there. Hopefully if someone can explain a nicer way they will, just trying to make you think about what you want to do. Quote Link to comment Share on other sites More sharing options...
zuperxtreme Posted August 20, 2009 Author Share Posted August 20, 2009 I need an answer quick. Not the best introduction... Hah, yeah. My bad. I'm just a bit desperate. PHP can do this. One way of accomplishing this is to store the xml info and the file into a table, which is not a very fun thing, but fast to do what you want. Then you wouldn't need to create directories, etc.. You would just go to like: index.php?file=somenumberorstring then it would show what you want. You could also get into the mess of creating directories and uploading the files to that directory. For that I would recommend a main directory for these new ones to go it or it will get messy in your web folder. Create a directory called 'data' or whatever, then in php when the user submits the file you need to create a new directory inside data and move all the files into there. Hopefully if someone can explain a nicer way they will, just trying to make you think about what you want to do. I'm not sure I follow ... what XML info? Writing the XML to link to the images I already did. What I want to know how to do is how to make those dynamic HTML's. They will most likely all be similar, but they need be a random alphanumeric string. :/ Anyone want to make 150 USD? Quote Link to comment Share on other sites More sharing options...
programming_passion Posted August 22, 2009 Share Posted August 22, 2009 Have you tried $rand_dir=md5(time()); this would give you the random name for your directory and then u can create the dir with this name or u can take the substring of this complete random string. Hope this will work for You. 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.