A user would click a submit button and a function would create a div in a gallery on my site with which they could link to if they wanted to share that content specifically. The content is just embedded and hosted on other sites like youtube so the user would not be actually uploading any content or need an account. It's a free open gallery that anyone could copy a url and paste into an input and submit that content into a div in the gallery.

Any ideas where to start? Would this require php?

有帮助吗?

解决方案

Well if you're a super beginner or something the first step would be to make your website just the way you want it and inside these div's you can just put the url that the user submitted instead of the content that url points to. [If you can do this then I assume you wouldn't need to ask this question, so don't mind me treating you like a complete beginner]

How would you achieve this? Well you're definitely need:

  1. Some sort of server side language (php is a good choice) that allows you to use the input from the user (The POST request from the form he/she submits),
  2. Check it for correctness / clean up the input / supported websites, etc.
  3. Save this information somewhere (a database) so that you can get it back later.

The next steps would be to now get the information from the database and show it on your gallery page like you want it. This involves:

  1. Getting whatever subset of information you want to display on a particular page from the database. Perhaps only cat related things or something, I don't know.
  2. Just displaying it in your div's using a for loop or something.

.

 foreach ($subset as $url) {
   echo "<div>$url</div>";
 }

Then the last step would be to convert these links into actual videos / images or whatever depending on the type of link. This can be done both client side using Javascript / server side using php or some other language.

This is going to be a lot of manual work, looking through every websites api and figuring out how to convert a url into a video for example. Images are easy but they may be hotlink protected so you might have to go through an API there as well.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top