|
DataDragon Information Services Scripting Information Good HTML and design are just the first steps to a successful web site. With CGI scripts you can add features to web pages such as feedback forms, counters and dynamic content. All these features come at a price, however. Most CGI scripts require you to know UNIX scripting languages such as Perl and have a familiarity with a UNIX shell. Here is a small snippet of Perl code that picks a random file. if ($RandomArray{$ENV{'QUERY_STRING'}}) { ($BaseDir,$VirtualDir,$FilesWanted) = split(/,/,$RandomArray{$ENV{'QUERY_STRING'}}); $DirListing = `ls $BaseDir$FilesWanted`; $DirListing =~ s/$BaseDir//g; @DirListing = split("\n",$DirListing); srand(time ^ $$) $Media = rand(@DirListing); print "Location: $BaseURL$VirtualDir$DirListing[$Media]\n\n"; } Actually, no. This code wouldn't even execute because we intentionally forgot an ending semi-colon 4 lines from the bottom. The moral of the story is to get someone who has experience scripting to create scripts for you. We invite you to look over some CGI scripts we've created to get a better idea of what CGI scripting can do for your website. | ||||||||||
Questions? Contact the webmaster Copyright (©) 1998, 1999 DataDragon Information Services |