He experts. I wrote this script but unfortunely when i run it i get the following erro. I am passing this script the number of songs as linke below:
the script supposed to write it to text file and play it but unfortunely it does. could any expert help me fix this error.i put permition for it as read and write but still does not work!Thanks
the script supposed to write it to text file and play it but unfortunely it does. could any expert help me fix this error.i put permition for it as read and write but still does not work!Thanks
Code:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Can't open songlist.txt at c:\inetpub\[URL unfurl="true"]wwwroot\cgi-bin2\textchat\multsong.pl[/URL] line 145.
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="[URL unfurl="true"]http://localhost/songs/g1.rm";[/URL]
last SWITCH;
}
if($fname eq "ID2")
{
$fname="[URL unfurl="true"]http://localhost/songs/g2.rm";[/URL]
last SWITCH;
}
if($fname eq "ID3")
{
$fname="[URL unfurl="true"]http://localhost/songs/g3.rm";[/URL]
last SWITCH;
}
if($fname eq "ID4")
{
$fname="[URL unfurl="true"]http://localhost/songs/g4.rm";[/URL]
last SWITCH;
}
DEFAULT:
{
$fname="[URL unfurl="true"]http://localhost/salma/m7.rm";[/URL]
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="[URL unfurl="true"]http://localhost/dll.js">[/URL]
</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="[URL unfurl="true"]http://localhost/cgi-bin2/songlist.txt">[/URL]
<EMBED SRC="$fname" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT=60 WIDTH=285 AUTOSTART=true>
</OBJECT>
</body>
</html>
method