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
https://forums.phpfreaks.com/topic/171048-creating-dynamic-website-adress/
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.

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

Archived

This topic is now archived and is closed to further replies.

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