
July 22nd, 2005, 02:16 PM
|
|
Contributing User
|
|
Join Date: Apr 2005
Posts: 207
Time spent in forums: 20 h 3 m 51 sec
Reputation Power: 4
|
|
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/...me=ID4&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
|