Google Answers Logo
View Question
 
Q: how can I upload a file to my site and have it automatically update pages showin ( No Answer,   3 Comments )
Question  
Subject: how can I upload a file to my site and have it automatically update pages showin
Category: Computers > Programming
Asked by: happy_cow-ga
List Price: $5.00
Posted: 29 Jun 2005 01:28 PDT
Expires: 29 Jul 2005 01:28 PDT
Question ID: 538230
Hello,
I am trying to create a server that shares legal mp3?s.
I would like to have the mp3?s organized so that they can be searched
and organized in a variety of ways, for example, through composer,
genre, date etc.  As of now, I have a website for each composer, and
then a list of their songs. I would like to allow people to browse
through songs by genre, date, composer, but currently to do this I
would have to then add a link to each of those pages every time I
uploaded a new song.

Is there a way to accomplish this automatically?  Is there some kind
of programming (php,cgi etc) that can do this so that I only have to
upload the song?  How do most sites accomplish this sort of thing?
What kind of requirements would my server have to do this?

Also, ideally, I would like to make a page where a person can upload
the song themselves, maybe check a few boxes, and have all the others
pages on my site update with the new song added.

Any ideas on how to do this would be very helpful.

thanks.
Answer  
There is no answer at this time.

Comments  
Subject: Re: how can I upload a file to my site and have it automatically update pages sh
From: bozo99-ga on 29 Jun 2005 03:58 PDT
 
If you operate the site and are able to install and run programs that
should be easy.

As part of the upload process the user selects the details and these
can be recorded in a suitable way.   Periodically new pages of links
can be generated from this data and renamed over the previous pages. 
That's when the new MP3s will appear.  If it is structured in this way
the CPU reqirements for remaking the web pages does not depend on the
number of site visitors.  Remaking the pages via CGI or PHP might be
unacceptably slow at peak times.
Subject: Re: how can I upload a file to my site and have it automatically update pages showin
From: phpwhiz-ga on 01 Jul 2005 09:12 PDT
 
This can be done with PHP. The only requirement is that you have to
enter the ID3 tags of the mp3 file correctly. PHP program can
automatically read the ID3 tags and save it into your database.

This way it updates the pages in your website and the song will be
shown under the desired category and you only have to upload the
songs.

Obviosly it requires some PHP coding to be done on your server. But i
tell you it is not complex and a php coder can do it within hours.

The requirements are PHP, MySQL database.

Hope this info helped you.

Thanks
Subject: Re: how can I upload a file to my site and have it automatically update pages sh
From: ckimbrell-ga on 14 Jul 2005 20:48 PDT
 
All you need is PHP and MySQL on your server. If so, this can be done
simply using a PHP script. You first upload all of your files, and put
them into the MySQL database, and then if a new user uploads a file it
automatically puts the information from the form into the database for
you. Each time the page is refreshed, the content is changed based on
what songs are available for download.

http://www.php.net/quickref.php

Check out the mysql server functions, and also the glob function. As
long as you have a reasonable amount of control over the server this
can be done with a fairly simple script. Let me know if you need any
help. A brief script follows:

<?php
$conn=mysql_connect("Yourhost","User","Pass");
mysql_select_db("All_Music");
$sql="SELECT date,genre,artist,title,filename FROM All_Music";
$res=mysql_query($sql);
if (!$res)
{
    exit("Query Failed!  ".mysql_error());
}
echo "<table border='1'><tr><th>Date<th>Genre<th>Artist<th>Title<th>File Name";
while ($row=mysql_fetch_row($res))
{
    echo "<tr><td>$row[0]<td>$row[1]<td>$row[2]";
    echo "<td>$row[3]<td><a href='$row[4]'>$row[4]</a>";
}
echo "</table>";
mysql_close($conn);
?>

That will just show you all of your information for every song in the
database, and give a link to download the file (assuming the file is
in the same directory). In order to sort them you'll have to put forth
a little more effort, but it shouldn't be hard.  The glob() function
searches all files with a given parameter in a certain folder. So,
glob("*.mp3") would show all of the mp3 files in the directory that
you run the glob command.

Hope I helped. Let me know if you need more.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy