Squirrelington Posted December 27, 2002 Share Posted December 27, 2002 the perl code runs fine and shows the data it should when using perl -W song.cgi however, when opened in wmp or a browser it shows ISE(Internet Server Error(HTTP Error 500)). I find that very odd and it is not server specific. I tested it on 2 seperate linux servers. Source code: http://24.29.176.236/song.txt CHMOD: 777 HTTPd: Apache 2.0.43 Perl: 5.8.0 OS: Mandrake Linux 9(linux 2.4.19-16mdk) Link to comment Share on other sites More sharing options...
0 Squirrelington Posted December 28, 2002 Author Share Posted December 28, 2002 the box is down right now cause some fruit added a perl script on there to hindr my internet useless, thx alot. hehe anyways i uploaded the source to http://cgi.neonblu.com/song.txt Link to comment Share on other sites More sharing options...
0 CitruS Posted December 29, 2002 Share Posted December 29, 2002 Before you output any of the data to the browser, add this: print "Content-type: text/html \n\n"; Link to comment Share on other sites More sharing options...
0 Squirrelington Posted December 29, 2002 Author Share Posted December 29, 2002 its not outputing html and its not to the browser, its to Windows Media Player. Its outputting ASX(XML style data) and the ASX data refers to a WMA file. Link to comment Share on other sites More sharing options...
0 Squirrelington Posted December 29, 2002 Author Share Posted December 29, 2002 ok i fixed it but it does not do the desired effect, new code at http://cgi.neonblu.com/song.txt Link to comment Share on other sites More sharing options...
0 CitruS Posted December 29, 2002 Share Posted December 29, 2002 You will have to find the content-type for asx/wma files. Link to comment Share on other sites More sharing options...
0 Squirrelington Posted December 29, 2002 Author Share Posted December 29, 2002 thats no longer the prob, the text/html worked, thx, but it isn't doin what it should with the other part(the whole reason i made it). to not allow it to be loaded by other sites(hotlinked). http_referer most of the tinme denies my own site from using the script too, any ideas? Link to comment Share on other sites More sharing options...
0 wired57 Posted December 30, 2002 Share Posted December 30, 2002 #!/usr/bin/perl $match = $ENV{HTTP_REFERER}; $query = $ENV{QUERY_STRING}; if ($match =~ m/:\/\/cgi\.neonblu\.com\//) { print <<EOM; open(FILE,"$query.asx"); print "Content-type: text/html\n\n"; print <FILE>; close(FILE); } elsif ($match) { print <<EOM; Content-type: text/html Music hotlinking is forbidden by Neonblu Technologies <BR> $match <A HREF="song.cgi?SSsynthetic">Return</A> EOM } else { print <<EOM; Content-type: text/html Music hotlinking is forbidden by Neonblu Technologies <BR> $match <A HREF="song.cgi?SSsynthetic">Return</A> EOM } try that Link to comment Share on other sites More sharing options...
0 Squirrelington Posted December 30, 2002 Author Share Posted December 30, 2002 (Value =~ RegEx) if true always just returns 1 so that code if(1) { is how it sees it, i tried that, the problem is that the script doesn't get a http_referer res[ponse even though its called from a page with an emebed script Link to comment Share on other sites More sharing options...
Question
Squirrelington
the perl code runs fine and shows the data it should when using perl -W song.cgi
however, when opened in wmp or a browser it shows ISE(Internet Server Error(HTTP Error 500)).
I find that very odd and it is not server specific. I tested it on 2 seperate linux servers.
Source code: http://24.29.176.236/song.txt
CHMOD: 777
HTTPd: Apache 2.0.43
Perl: 5.8.0
OS: Mandrake Linux 9(linux 2.4.19-16mdk)
Link to comment
Share on other sites
8 answers to this question
Recommended Posts