Jump to content

Creating dynamic website adress


zuperxtreme

Recommended Posts

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 ...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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? :P

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.