PHP - Php (maybe Jquery) Music Upload / Player
Hello Peeps
Let's see if i can get out what i need to ask. Origin for Question: I have started to get into making Music. I create it(incomplete songs) on one pc and then normally have to upload it to the web and download it on another pc hooked upto a stereo and sound system. What i would prefer: I would like to make it on one pc and then upload it to a site and then the other pc can just goto the site like.. mysite.com/play.php?id=4 The Question: What would i need to look up for the best way to be able to upload and then play the song. i would not want to have it so i upload it and have to download it but rather i can go to a page as quoted above and there is simply a song playing there. i would like it to do something like the following * mySite.com has an upload section * when the file is uploaded it is saved as $id.mp3 (so first upload is 3 snd upload is 4.mp3 and so on.) on that note i'm also thinking of having it so i have to be logged in so then i can have $username-$id.mp3 *i would then like it to display the link.. ( Thankyou your upload is complete. your link is mysite/play.php?$username-$id.mp3) *then on that play page i would like a player that can load the song and play it by the vars.. so it looks for the $id and $username vars and then plays the file with that name. So i'm not asking for anyone to build this. i want to build it but i'm not sure what to look up for this. i feel i could so far do the login and research the upload and saving file names But its the music player side im confused on is there something out there in jquery or something maybe? i do not want to use flash.. i dont think :S I hope this makes sense and hope someone can help. Thanks Similar TutorialsThere are websites like Soundcloud, Soundclick, MySpace and more.
The Question:
How to not get a law suite as a website owner when copyright protected music or in other words music from the retail has gotten uploaded?
Will moderating it and having it frequently taken down do the job?
I know that the users themselves could get researched too. The site owner could get requested to give out IP addresses. Though, I kept this separately from that question.
I basically would be looking to be safe and not get a law suite.
I would appreciate the suggestions a lot.
hi! i want to upload videos and music files using php but it's not working correctly.through this code imges are uploaded successfully but there is problem with video files ..i hv use php.ini to resolve the size prblem but still its not working..can u give me any code that works perfectly. here is my code.. Collapse <?php ini_set('post_max_size', 5242880); // Set upload limit (5MB) ini_set('upload_max_filesize', 5242880); // Enforce upload limit ini_set('max_execution_time', 2400); // Increase 'timeout' time echo "<form enctype='multipart/form-data' name='form2' method='post' action='video.php?view_id=view'>"; if(isset($_REQUEST['Submit'])) { print_r($_FILES['file2']); $music=($_FILES['file2']['name']); if($_FILES['file2']['error']>0) { echo "error accured"; } else { move_uploaded_file($_FILES['file2']['tmp_name'],"uploadedMusic/".$_FILES['file2']['name']); } } echo "<input name='file2' type= 'file'>"; echo "<input name='Submit' type='submit' value='upload music'>"; echo "</form>"; ?> This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=314887.0 well.. i have vbulletin 4 forum i try to put video player so if i upload mp4 file so i can play video but sad part is its working only at firefox browser can you help me out .. video code looks like this
<vb:if condition="$attachment[attachmentextension] == mp4"> pls i really want that put to work in every browser sadly it works only in firefox somehow.. I have code written for image uploading, but it doesn't allow multiple images on a single upload, and doesn't re-size. Anyone willing to share a good upload script that will do the following?: -Allow multiple image uploads (10+ per submission), -Re-size images on upload, and -Rename images. Thanks Brett Hi everyone, I have a page that i use to upload images to my website, i got a bit fed up of uploading one at a time so i decided to add multiple file fields to the form to upload multiple images at the same time. Im having a few problems, iv read up he http://www.php.net/manual/en/features.file-upload.multiple.php and it seems all i have to do is add [] to the form names to turn them into arrays. However when i come to upload the images, i keep getting the "$error[] = "Incorrect format!...." error from the code below. I cant seem to figure out what the problem is. Could anybody please point me in the right direction? <?php session_start(); $id = $_SESSION['id']; $connect = mysql_connect("localhost","leemp5_admin","p7031521"); mysql_select_db("leemp5_database"); $query = mysql_query("SELECT * FROM users WHERE id='$id'"); $row = mysql_fetch_assoc($query); $username = $row['username']; $submit = $_POST['submit']; $type = $_FILES['image']['type']; $size = $_FILES['image']['size']; $max_size = "1000"; $width = "100"; $height = "100"; $error = array(); function make_thumb($image_name,$filename,$new_width,$new_height) { $ext=getExtension($image_name); if(!strcmp("jpg",$ext) || !strcmp("jpeg",$ext)) $source_image=imagecreatefromjpeg($image_name); if(!strcmp("png",$ext)) $source_image=imagecreatefrompng($image_name); if(!strcmp("gif",$ext)) $source_image=imagecreatefromgif($image_name); $old_x=imageSX($source_image); $old_y=imageSY($source_image); $ratio1=$old_x/$new_width; $ratio2=$old_y/$new_height; if($ratio1>$ratio2) { $thumb_width=$new_width; $thumb_height=$old_y/$ratio1; } else { $thumb_height=$new_height; $thumb_width=$old_x/$ratio2; } $destination_image=ImageCreateTrueColor($thumb_width,$thumb_height); imagecopyresampled($destination_image,$source_image,0,0,0,0,$thumb_width,$thumb_height,$old_x,$old_y); if(!strcmp("jpg",$ext) || !strcmp("jpeg",$ext)) { imagejpeg($destination_image,$filename); } if(!strcmp("png",$ext)) { imagepng($destination_image,$filename); } if(!strcmp("gif",$ext)) { imagegif($destination_image,$filename); } imagedestroy($destination_image); imagedestroy($source_image); } function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } if($submit) { $image=$_FILES['image']['name']; if ($image) { $filename = stripslashes($_FILES['image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif")) { $error[] = "Incorrect format! Please make sure your image is a .jpg, .jpeg, .png or .gif file."; } else { $size=getimagesize($_FILES['image']['tmp_name']); $sizekb=filesize($_FILES['image']['tmp_name']); if ($sizekb > $max_size*1024) { $error[] = "Your image is too big! The maximum upload size is 1MB."; } else { $image_name=time().'.'.$extension; $newname="uploads/" . $username . "/images/".$image_name; $copied = copy($_FILES['image']['tmp_name'], $newname); if (!$copied) { $error[] = "There was an error uploading your image. Please try again!"; } else { $thumb_name='uploads/' . $username . '/images/thumbs/thumb_'.$image_name; $thumb=make_thumb($newname,$thumb_name,$width,$height); } } } } else { $error[] = "Please select an image to upload!"; } if(empty($error)) { echo "Upload Successfully!<br />"; echo '<img src="'.$thumb_name.'">'; mysql_query("INSERT INTO images VALUES ('','$username','$image_name','','','','','uploads/$username/images/$image_name','uploads/$username/images/thumbs/thumb_$image_name','$type','$size')"); } else { echo implode($error); } } ?> <form method="post" enctype="multipart/form-data" action="upload_images.php"> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="file" name="image[]" /><br /> <input type="submit" name="submit" value="Upload"> </form> Thanks Hi, can anybody shed some light on the sort of topics i should look into for the following... and any brief code for this! A system to be used, by music shops, and record companies, to allow communication between them. Enable shops to place orders with the appropriate record company when stocks get low. It should also be used to communicate sales from shops to the record company for the purpose of compiling charts. Finally customers should be informed of release dates of artists in their favoured genre of music by text. thanks in advance Hi All .... I am new to php and i am droning over here ... We are starting a new online store and I am having a huge problem with my music API. What happens is that the api does a search ...I can vouch for that because I have a mailer that sends me a failed list ...@ this point everything cannot be found. My Dvd's working with the IMDB Api works perfectly and all the info gets stored to my MySql DB. This is my code for the music function GetMusicData($album, $artist, $id) { global $db; $artist = str_replace(" ", "+", $artist); $artist = strtolower($artist); $album = str_replace(" ", "+", $album); $url='http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=801bf08fc2c46659ad7878778edb72b3&artist='.$artist.'&album='.$album.'&autocorrect=1' ; $ch = curl_init ($url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); $dt=curl_exec($ch); curl_close ($ch); $data = new SimpleXmlElement($dt, LIBXML_NOCDATA); $tracklist = NULL; $x = (array)$data; Any help would be much appreciated as I can't see why I am not able to get any information. I have just over 9000 entries in my DB of well known and not so well known artists but I can't find any information. Been working on a xhtml website for university. Wanted to add a place where artists for hendohiphopshow.com could submit music. Did some research and came up with 'some' code. Not sure if it is close, or completely off. I have NO php experience. So any input/help would be a major help. http://www.hendohiphopshow.com/music_form.html http://www.hendohiphopshow.com/scripts/uploadmusic.php Thanks P.S. I have already handed this into Uni, I am developing this for my own use now. This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=345549.0 This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=354424.0 can anyone tell me whats this player and the settings for playing mp3 files with this player thanks http://img146.imageshack.us/i/84129977.jpg files that upload during insert/submit form was gone , only files upload during the update remain , is the way query for update multiple files is wrong ? $targetDir1= "folder/pda-semakan/ic/"; if(isset($_FILES['ic'])){ $fileName1 = $_FILES['ic']['name']; $targetFilePath1 = $targetDir1 . $fileName1; //$main_tmp2 = $_FILES['ic']['tmp_name']; $move2 =move_uploaded_file($_FILES["ic"]["tmp_name"], $targetFilePath1); } $targetDir2= "folder/pda-semakan/sijil_lahir/"; if(isset($_FILES['sijilkelahiran'])){ $fileName2 = $_FILES['sijilkelahiran']['name']; $targetFilePath2 = $targetDir2 . $fileName2; $move3 =move_uploaded_file($_FILES["sijilkelahiran"]["tmp_name"], $targetFilePath2); } $targetDir3= "folder/pda-semakan/sijil_spm/"; if(isset($_FILES['sijilspm'])){ $fileName3 = $_FILES['sijilspm']['name']; $targetFilePath3 = $targetDir3 . $fileName3; $move4 =move_uploaded_file($_FILES["sijilspm"]["tmp_name"], $targetFilePath3); } $query1=("UPDATE semakan_dokumen set student_id='$noMatrik', email= '$stdEmail', surat_tawaran='$fileName', ic='$fileName1',sijil_lahir='$fileName2',sijil_spm= '$fileName3' where email= '$stdEmail'");
hey back again, I need help finding something like the audio player found at www.soundowl.com. I need it to be similar in the sense that the URL of the file cannot be found in the source code and this is exactly what I need for my website, any help will be appreciated, thank you in advance the below works in firefox but doesn't work in internet explorer is there something wrong with it <?php $file = $_GET["Watch"]; echo "<OBJECT ID='MediaPlayer' WIDTH='450' HEIGHT='310' CLASSID='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'> <PARAM NAME=".$file." VALUE='../audio/audio_files/".$file.".wmv'> <PARAM NAME='autostart' VALUE='false'> <PARAM NAME='ShowControls' VALUE='true'> <PARAM NAME='ShowStatusBar' VALUE='true'> <PARAM NAME='ShowDisplay' VALUE='false'> <EMBED TYPE='application/x-mplayer2' SRC='../dvds/dvd_files/".$file.".wmv' NAME=".$file." WIDTH='450' HEIGHT='310' ShowControls='1' ShowStatusBar='1' ShowDisplay='0' autostart='0'></EMBED> </OBJECT>"; ?> Hi I'm building a site that contains access to some mp3 files of people speaking English. I would like a media player that is able to handle a variable that results from a database search. I can use <a href etc> to link to the relevant file but would like to use a server-side player to stream the file, rather than the client's browser. Something like Dewplayer would be perfect but it seems only to take a static file (maybe I'm wrong there). The player appears within <object> tags, like this <code> echo '<object type="application/x-shockwave-flash" data="/player/dewplayer.swf" width="200" height="30" id="dewplayer" name="dewplayer">'; echo '<param name="movie" value="/player/dewplayer.swf" />'; echo '<param name="flashvars" value="mp3=file.mp3" />'; echo '<param name="wmode" value="transparent" />'; echo '</object>'; </code> (the code is freely downloadable so hope I'm not breaking any rules posting someone else's code here). Is there a way I can specify a variable in value? If not, does anyone know of a player that I can use that does allow that? Grateful for any help. Thanks in advance. For some reason, I can get this file to play in the web browser, but I can not get it to play in my flash player. File: http://envne.com/music/play.php?id=23156 The file is a file that uses cURL, to load the song from the saved url. I am thinking that it is a cURL thing, because when displayed in my google browser, the load bar doesn't load on my page, but on the link below it does display I use other songs in the same flash player by just linking to a different id number and those songs play fine in the player. Why does this song do this, and others don't? File on the web: http://kickkicksnare.com/wp-content/uploads/2010/05/Like-a-G6-Ft.-The-Cataracs-Dev.mp3 The PHP: $ch = curl_init(); header('Content-Type: audio/mpeg'); curl_setopt($ch, CURLOPT_URL, $row['url']); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_FRESH_CONNECT, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_exec($ch); header("Content-Transfer-Encoding: binary"); header("Content-Type: ".curl_getinfo($ch, CURLINFO_CONTENT_TYPE).""); header("Content-Length: ".curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD).""); curl_close($ch); Hi guys. My situation is the following... I want to be able to play videos on a website using a media player. I currently have the pathnames of the videos stored in a mysql database and the videos stored on my file system. I intend to use some PHP script in order to locate the video pathname in the database and then pass it to the media player where it will play the file. I was wondering how i go about this? as i am fairly new to PHP. The media player i am using can be found at: http://rainbow.arch.scriptmania.com/scripts/music/video.html Any help would be much appreciated I confess I am not a php coder but have managed to build a youtube player which plays from a list which is generated by a flat file data base. http://www.d-sine.com/DEV/CHW/movies/index.php I have also (nearly) built an admin backend where users can edit the database and add, delete and update their movie player list. http://www.d-sine.com/DEV/CHW/movies/admin/ pass = password the problem I have is that when the list is edited it throws in a return (a blank line) into the database resulting in an error when the player is refreshed after the change. When this blank line is taken out all is fine, I have got so close its frustrating arrrgghh Can anyone help??? The code in full is attatched Open Source, so if it is any use to anyone, be my guest ;-) Hoping someone could help me with hiding a video player if a video is not present in the db. I have split up the code to make it easier to understand. Thanks in advance (int) $ListId=$_GET['ListID']; function mysql_resultTo2DAssocArray ( $result) { $i=0; $ret = array(); while ($row = mysql_fetch_assoc($result)) { foreach ($row as $key => $value) { $ret[$i][$key] = $value; } $i++; } return ($ret); -------------------------------------------------------------------------------------------- $querys = mysql_query("SELECT * FROM video WHERE listingID = '$ListId' "); $Details_video=mysql_resultTo2DAssocArray ($querys); -------------------------------------------------------------------------------------------- <div class="right_col"> <p id='preview'>The player will show in this paragraph</p> <script type='text/javascript' src='/flvPlayer/swfobject.js'></script> <script type='text/javascript'> var s1 = new SWFObject('/flvPlayer/player-viral.swf','player','280','200','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('autostart','true'); s1.addParam('image','/flvfiles/<?php echo $Details_video[0]['imagePath']?>'); s1.addParam('flashvars','&file=/flvfiles/<?php echo $Details_video[0]['videoPath']?>&image=/flvfiles/<?php echo $Deatls_video[0]['imagePath']?>&dock=false&autostart=true'); s1.write('preview'); </script> |