This was a toss up between this forum and the Java forum...
I have a CGI script, and I want to execute it using the java script code:
This has worked before, but now its not. Here is the CGI file that I'm trying to "convert"
$random_file = "/home/username/public_html/directory/random.txt";
$delimiter = "\n\%\%\%\%\n";
open(FILE,"$random_file") || &error('open->random_file',$random_file);
@FILE = <FILE>;
$phrases = join('',@FILE);
@phrases = split(/$delimiter/,$phrases);
srand(time ^ $$);
$phrase = rand(@phrases);
print "document.write(Content-type: text/html');\n\n";
What seems to be the problem here?
Thanks in advance.
PS: If you know of a Java script file that randomly chooses information from an external file, please tell me.