freeman-777 Posted September 24, 2007 Share Posted September 24, 2007 Hello Sirs/Madams I am currently trying to program a sort of MySpace. I need help.... your help!! If you have the answers please do help! I want to implement this: * Users must be able to upload MP3 * Users must be able to change/edit songs * It must be in session * When other users click on their profile, they must be able to listen to their music. THE MAIN ONE: implement MP3 Script for MysQL database Please do let me know With VERY VERY KIND REGARDS THE FREEMAN Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/ Share on other sites More sharing options...
Fadion Posted September 24, 2007 Share Posted September 24, 2007 * When the user registers, create a folder for them where to upload music and photos. Make an upload form for the users to upload mp3s. U can add the uploaded mp3s to a database, meaning the path and any other information u need. * Show each mp3 in that user's folder by a database query, with button to edit or delete them. Both the actions will affect the database and folder. Deleting a database record, deletes also the path of the mp3 the record had. Updating the database will also update the mp3 file. * I dont know what u mean by being in session. What will have to be stored in sessions (temporary cookies)? * Make a flash mp3 player or just get one. Flash is very balanced and powerful so im sure u wont have problems. It can also interact with php scripts for database queries and stuff. In this case u just need to make a nice looking flash mp3 player with pan, volume, and play stop buttons, and a simple script which loads songs from the folders. Hope i gave some good advice. Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354106 Share on other sites More sharing options...
eZe616 Posted September 24, 2007 Share Posted September 24, 2007 * When the user registers, create a folder for them where to upload music and photos. Make an upload form for the users to upload mp3s. U can add the uploaded mp3s to a database, meaning the path and any other information u need. * Show each mp3 in that user's folder by a database query, with button to edit or delete them. Both the actions will affect the database and folder. Deleting a database record, deletes also the path of the mp3 the record had. Updating the database will also update the mp3 file. * I dont know what u mean by being in session. What will have to be stored in sessions (temporary cookies)? * Make a flash mp3 player or just get one. Flash is very balanced and powerful so im sure u wont have problems. It can also interact with php scripts for database queries and stuff. In this case u just need to make a nice looking flash mp3 player with pan, volume, and play stop buttons, and a simple script which loads songs from the folders. Hope i gave some good advice. Does every user has to have there own folder? Or can every mp3 be in one folder? Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354147 Share on other sites More sharing options...
BlueSkyIS Posted September 24, 2007 Share Posted September 24, 2007 all mp3s could be in one directory. Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354148 Share on other sites More sharing options...
freeman-777 Posted September 24, 2007 Author Share Posted September 24, 2007 Thank you very much it does make a lot of sense!! Just a couple of questions: 1.) Does anyone know where I could learn how to create file upload for MP3s 2.) When The files gets uploaded (in a folder: http://www.mysite.com/mp3/), should I change the names i.e. blues.mp3 to some kind of encryption.mp3 or just keep it blues.mp3? Can someone lead me into the direction to be able to implement it in more detail - THANKS ALL THE ANSWERS ARE GREAT!!!! - Is there an online tutorial/upload MP3 - I need some help, I can read through anything and study all night if I must! Thanks so MUCH!!! Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354293 Share on other sites More sharing options...
freeman-777 Posted September 24, 2007 Author Share Posted September 24, 2007 Being in session - I mean that the members needs to be logged in in order to upload songs Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354294 Share on other sites More sharing options...
cooldude832 Posted September 24, 2007 Share Posted September 24, 2007 uploading large amounts of media to your server is like dropping a turkey on your dog (I saw it on mythbusters wasn't pretty) you will eat up your bandwidth, hd space etc etc. Also not to mention the inherited legal obligations to the media if it is their own property to distribute. For that reason I'd suggest you store them in a protected manner, or not at all. Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354296 Share on other sites More sharing options...
freeman-777 Posted September 24, 2007 Author Share Posted September 24, 2007 High Bandwidth is good, large amount of data is good. I just need some kind of tutorial about Uploading MP3's, or someone to show me (if possible) how to code a basic upload (like uploading an image but instead an MP3) If someone can be GREAT!!! Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354303 Share on other sites More sharing options...
Fadion Posted September 24, 2007 Share Posted September 24, 2007 all mp3s could be in one directory. Actually having mp3s in folders for each user should just make a more structured file system. Each method brings the same results and theres no basic difference. As cooldude said, letting users upload mp3s will eat a lot of bandwidth. If u have thousands of users, imagine them uploading 4-5 mp3s each. Even if standart shared hosts today offer a great amount of bandwidth (up to 100 GB and even more), consider the speed of processing. But these are your stuff anyway and im sure uve thought about it. Just be sure to configure php as needed, making the right adjustments to max upload, execution etc. A simple file upload example, considering u just have a form (with enctype: multipart/formdata) and a submit button: <?php $filename = $_POST['file']['name']; $ext = strtolower(substr(strrchr($filename, '.'), 1)); $size = $_POST['file']['size']; if($ext == 'mp3'){ if($size <= 5000000){ if(move_uploaded_file($_POST['file']['tmp_name']), "songs/{$filename}"){ echo "The file {$filename} was uploaded successfully."; } else{ echo 'There was an error uploading your file. Please try again.'; } } else{ echo "The size of the song u chose is too big."; } } else{ echo 'The format u chose is either not supported or not a music file.'; } ?> Hope it makes sense and fits what u need. Quote Link to comment https://forums.phpfreaks.com/topic/70474-i-wany-to-implement-mp3-with-community-website/#findComment-354472 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.