473,597 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why the loop is not working?Playing mp3 file

29 New Member
Thanks in advance.


Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  2. "http://www.w3.org/TR/html4/loose.dtd"> 
  3. <html> 
  4. <head> 
  5. <title>Untitled Document</title> 
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
  7. <SCRIPT TYPE="text/javascript">
  8. <!--
  9. function soundplay()
  10. {
  11.     if (navigator.appName == "Netscape")
  12.    {
  13.    document.MySound.play(false)
  14.    return false;
  15.    }
  16. else
  17.    return true;
  18. }
  19. //-->
  20. </SCRIPT>
  21. </head> 
  22. <body> 
  23.  
  24.       <?
  25.  
  26.        $music=$_GET['music'];
  27.  
  28.             $dir ="song";
  29.  
  30.  
  31.  
  32.             $dh = opendir($dir);
  33.  
  34.  
  35.  
  36.             while ( !(($file = readdir($dh)) === false) )
  37.  
  38.             {
  39.  
  40.  
  41.  
  42.                 if ($file == "." || $file == "..") continue;
  43.  
  44.  
  45.  
  46.                 if (eregi(".wav",$file))
  47.  
  48.                     {
  49.  
  50.  
  51.  
  52.  echo' <a href="?music=true&file='. $dir . '/' . $file  . '" onClick="return soundplay()">'.$file.'</A>';
  53.  
  54.  
  55.  
  56.  
  57.                 }
  58.  
  59.             }
  60.  
  61.             if($music == 'true')
  62.         {
  63.  
  64.                                $file = $_GET['file'];
  65.  
  66.  
  67.                   echo '<EMBED  src="'. $dir . '/' . $file . '"  NAME="MySound"  HEIGHT=144 WIDTH=166 MASTERSOUND HIDDEN >';
  68.  
  69.               }
  70.  
  71.  
  72.  
  73.       ?>
  74. </body> 
  75. </html> 
  76.  
  77.  
  78.  
  79.  
  80.  
Aug 18 '07 #1
2 1503
Atli
5,058 Recognized Expert Expert
What exactly is the problem?
Are you receiving any errors?

Please take a look at our posting guidelines before posting.
Posting Guidelines - How to ask a question
Aug 18 '07 #2
sumaabey
29 New Member
i correct it and thanks for your response
Aug 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4665
by: Knocked Wood | last post by:
Hi, I looked around and can't find anything on this at all and can not get it to work for IE. I'm trying to loop multiple sounds on a game, with three unique variables, when a link is clicked. Something like... <Script Language="JavaScript"> <!-- function playSound(soundName, loops, timeLength){
20
4403
by: gallery | last post by:
Our client insists on having a music loop playing as the visitor travels throughout his new HTML website. We will not be doing this in frames and I would prefer not to have the home page spawn new pages from its links. Although that's the only solution that I know of. Does anyone have another solution?
4
3705
by: Ryan Ternier | last post by:
Thanks for the previous help guys! I got my list box issue working, but now i'm trying to loop through all the items in my page. I want to find each listbox, once I do i strip the ID down to find what I need so I can populate a DB. lstTest is dim'd as a ListBox, and I thought I could just do:
7
6448
by: Lee Moody | last post by:
I just want quick and easy way to play a .wav file out the standard sound device. It could even be as simple as activating a sound assigned to an existing windows sound event. Any suggestions? Thanks in advance. -Lee
4
2219
by: Arnold | last post by:
Hi there, Here's the situation--there is a text field in a form in which students will key in data. On the keypress event, I'd like for different sounds to be played for each character typed, either randomly or in a loop (I have a number of small, cool, computer-like sounds). I can get one sound to play for the keypress event, but don't know how to play multiple sounds. Here's the codes for playing one sound...
7
4218
by: Anil Gupte | last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu2Exit.Click Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName) File.Delete(L3Global.VideoFileName) ' The following is not working - reports directory not empty exception ' Directory.Delete(fDir)
3
12177
elamberdor
by: elamberdor | last post by:
Hi all! Well, I'd like to cut down my file size get my external BG sound to loop.... I've got an external sound file playing fine, however just once. Looking around the net hasn't yeilded much results for external sound loops, Is it possible? =) Here is my working (but not looping) code:
17
1471
by: takayuki | last post by:
Hi, I'm studying python via the exellent book "How to think like a python programmer" by Allen Downey. Noob question follows... animals.txt is a list of animals, each on a separate line: "aardvard, bat, cat, dog, elephant, fish, giraffe, horse, insect, jackelope"
1
2779
by: rockchicx23 | last post by:
i have to write a program that is a guessing the number game. the user has to choose the number of games they want to play. i need help setting up the loop that will run the number of times the user wants it to here is my code so far //Assignment 2 Play //In this guessing game the user will be asked to guess a number from between 1-100 //The user has ten tries if they donot guess the right number its game over //The user also gets to...
0
7979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6706
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1497
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.