Jump to content

FrankGalos

New Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by FrankGalos

  1. <?php if(isset($_POST['submit'])){ echo $file = $_FILES['vm']['name']; $type = $_FILES['vm']['type']; $size = $_FILES['vm']['size']; echo $error= $_FILES['vm']['error']; $file_loc = $_FILES['vm']['tmp_name']; $path = 'uploads/'; if(!empty($file)){ if(preg_match('/\.(mp4|webm|ogg|mp3|jpg)$/i',$file)){ if($error === 0){ if(move_uploaded_file($file_loc,$path.$file)){ echo 'uploading successfuly'; }else{ echo 'upload failed'; die(); } }else{ echo('error in file'); } } }else{ echo 'file can not be empty'; die(); } } ?> <form action="filehandler.php" method="post" enctype='multipart/form-data'> file<input type = 'file' name='vm' ><input type="submit" name="submit" value="submit"> </form>
  2. Hello i m trying to upload video files using AMPPS server with php 5.6 in it but when i uploads it gives me an error report in file that i uploading , and when i uploads an image file it upload with no error so i don't understand why it doesn't uploading videos/audios . please help if you have an clue in this thing
  3. here the javascript code var audio,progressi,curTime,durTime,play,pause,playpaus; function initializer(){ audio = _('myaudio'); progressi =_('progressBar'); pause = _('pause'); play =_('play'); curTime = _('curTime'); durTime = _('durTime'); progressi.addEventListener('change', progress,false); audio.addEventListener('timeupdate',seekTime,false); } window.onload = initializer; function playpause() { if(audio.paused){ audio.play(); play.style.display='none'; pause.style.display='block'; }else{ audio.pause(); play.style.display='block'; pause.style.display='none'; } } function progress(){ var percent = audio.duration *(progressi.value / 100); audio.currentTime = percent; } function seekTime(){ var nt = audio.currentTime *(100/ audio.duration); progressi.value = nt; var curMins = Math.floor(audio.currentTime / 60); var curSec = Math.floor(audio.currentTime - curMins * 60 ); var duMins = Math.floor(audio.duration / 60); var duSec = Math.round(audio.duration - duMins * 60); if(curMins < 10){curMins = '0'+curMins;} if(curSec < 10){curSec = '0'+curSec;} if (duMins < 10) {duMins = '0'+duMins;} if (duSec < 10) {duSec = '0'+duSec;} curTime.innerHTML = curMins+':'+curSec; durTime.innerHTML = duMins+':'+duSec; }
  4. Hello freaks i m trying to make a simple upload application that upload audio files and video files it working fine in uploading and displaying data from the database but i got a problem in playing audio and video file on my player . The program is like this it take audio reference file from the database and when data are collected HTML 5 play via javascript play it part and it working fine but the problem that when i click play of the first row name on database it playing but when i click play another song it play the first song row in the database and i have no cruel on this please help: here the code $sql = "SELECT * FROM music ORDER BY id DESC"; $q=$con->query($sql); if($q->num_rows > 0){ while ($row = $q->fetch_array()){ $id = $row['id']; $name = $row['name']; $type = $row['type']; $fileLoc = "MUPLOADS/"; $desc = $row['description']; html code <span id="by" title="uploaded by <?php echo $name;?>"><?php echo 'Uploaded by '.$name;?></span> <span id="controlers"><img src="images/icons/play.png" alt="play" id="play" onclick="playpause()"><img src="images/icons/pause.png" alt="pause" onclick="playpause()" id="pause"> <audio src="<?php echo $fileLoc.$file.'.mp3';?>" id='myaudio'></audio> </span>
  5. Cyber . thank you very much but i tested this before in my code but the player come and disappear and i don't know the solution of this
  6. Much thanks to you cyberRobot for not get tired at me. that listen file it's mainly purpose is to play audio file that parsed by music file that hold select queries, In listen file i want to set a html5 player to play audio files from the database. that is what i was asking . and i don't know how to set php variables in html5 <audio> tags
  7. Hello cyberRobot. thank you for your answer That <a>tags is working fine but that is not my purpose my purpose is to play them directly
  8. Hello friends: I have audio and video files from html form to mysql database with php. in storing data it ok but the problem is to play those data which i have already fetched them . please if there is anyone who knowlegeable and exprience in this thing. please help here the code to display them $sql = "SELECT * FROM music"; $q=$con->query($sql); while ($row = $q->fetch_array()){ $id = $row['id']; $name = $row['name']; $type = $row['type']; $fileLoc = $row['data']; $desc = $row['description']; $file = $row['file']; $cre = $row['created']; echo '<a href="listen.php?fl='.$fileLoc.'&f='.$file.'">'.$name.'</a> ' .$desc.'<br />'; }
×
×
  • 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.