• 0

Another perl problem


Question

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

  • 0

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

  • 0

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

  • 0

#!/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

  • 0

(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

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.