Results 1 to 1 of 1

Thread: Problem writing multiple songs url to text file

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Arrow Problem writing multiple songs url to text file

    Hi experts. I got a perl script that supposed to write song urls to text file but unfortuenly it writes only one song on the text file. If i select song 2 and song 3 from check box it only writes the latest one which is 3. Is there a way to write multiple songs to text file since i am using check boxes . Like example below
    http://localhost/cgi-bin2/textchat/m...4&name=ID7

    I be happy if an expert help me fix this thanks

    Code:
    #!/usr/bin/perl
    
     
    SWITCH:
    {
    
    @pairs = split(/&/, $ENV{"QUERY_STRING"});
    
    foreach $pair (@pairs) {
     ($name, $value) = split (/=/, $pair);
     $formData{"$name"} = $value;
    }
    
    $fname = $formData{name};
    
    if( $fname eq "ID1" )
    {
    $fname="http://localhost/songs/g1.rm";
       last SWITCH;
    }
    if($fname eq "ID2")
    {
    $fname="http://localhost/songs/g2.rm";
    last SWITCH;
          
    }
    
    if($fname eq "ID3")
    {
    $fname="http://localhost/songs/g3.rm";
    last SWITCH;
          
    }
    if($fname eq "ID4")
    {
    $fname="http://localhost/songs/g4.rm";
    last SWITCH;
          
    }
    DEFAULT:
    {
    $fname="http://localhost/salma/m7.rm";
    last SWITCH;
    }
    }#END OF SWITCH BLOCK
    
    
    
    
    $outfile= 'songlist.txt';
    open(OUTPUT, ">$outfile")or die "Can't open $outfile";
    
    close(OUTPUT);
    
    
    #################################################################################
    #Defult Subroutines
     
    
    
    print <<method;
    
    <html>
    <head>
            <title>Voice Music</title>
    </head>
    
    <script language=JavaScript src="http://localhost/dll.js">
    </script>
    
    
    <body bgColor=#336699 leftmargin="0" topmargin="0">
    
    #Real Audio Applet
    <OBJECT ID=video1 CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT=60 WIDTH=285>
    <PARAM NAME="controls" VALUE="ControlPanel,StatusBar">
    <PARAM NAME="console" VALUE="Clip1">
    <PARAM NAME="autostart" VALUE="true">
    <PARAM NAME="src" VALUE="http://localhost/cgi-bin2/songlist.txt">
    <EMBED SRC="$fname" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT=60 WIDTH=285 AUTOSTART=true>
    </OBJECT>
    
    </body>
    
    </html>
    
    method
    Last edited by tony007; Jul 22nd, 2005 at 01:06 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width