Link to home
Create AccountLog in
Avatar of aej1973
aej1973

asked on

playing audio file using php/html..

Hi, I have an audio file on my server, it is located in "/var/lib/music". Can someone let me know how I can use php/html  play this music file on my browser? Thank you.

A
Avatar of Gary
Gary
Flag of Ireland image

What type of audio file is it
Avatar of aej1973
aej1973

ASKER

wav file.
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of aej1973

ASKER

I hope someone will be able to help me with this one. The following script works
echo '<tr class="list">';
         echo '<td align="left"><span class="ast">'.$row['moh_name'].'</span></td>';
         echo '<td align="left"><span class="ast">'.$row['moh_name'].'</span></td>'; 
          echo '<td><embed src="test.wav" align="baseline" border="0" width="145" height="25" autostart="false" loop="true"></td>';                       
echo '<td align="left"><form action="" method="post"><input type="hidden" name="moh_id" value='.$row['moh_id'].'><input type="Submit" name="Submit"  value="Delete" onclick="return delete_confirm();"></form></td>'; 
	   echo '</tr>';

Open in new window

, but the following script does not work;
echo '<tr class="list">';
         echo '<td align="left"><span class="ast">'.$row['moh_name'].'</span></td>';
         echo '<td align="left"><span class="ast">'.$row['moh_name'].'</span></td>'; 
          echo '<td><embed src="/var/lib/music/test.wav" align="baseline" border="0" width="145" height="25" autostart="false" loop="true"></td>';                       
echo '<td align="left"><form action="" method="post"><input type="hidden" name="moh_id" value='.$row['moh_id'].'><input type="Submit" name="Submit"  value="Delete" onclick="return delete_confirm();"></form></td>'; 
	   echo '</tr>';

Open in new window


Can someone let me know what the problem could be. The working file is in the same folder as my web pages (ie) /var/www/webpages. The second file is in the folder that has permission -rw-r--r--  and group/owner www-data. Thank you for the help.

A
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of aej1973

ASKER

How do I do that?
Avatar of aej1973

ASKER

GaryC123, you have pointed me in the right direction. I have opened another questions to see how to accomplish this. Thank you.

A
A symlink is just a shortcut, do you have command line access? If so just do...

ln -s <path_to_folder_of_audio_files> <link_name>

If it's shared hosting you would need to ask your host

Then to access the audio file you would just use the link_name/test.wav