#!/usr/bin/perl # # create a web page pointing to a multimedia file ########## ## change this URL to point at the pmake.html form $returnurl = "http://hemi.ps.tsoa.nyu.edu/eng/seminar/images/pmake.html"; umask( 002 ); use CGI; $q = new CGI; &htmlheader( "pmake.cgi" ); $|=1; $url = $q->param('url'); $url = "/eng/seminar/images/320/".$url; $alt = $q->param('alt'); $desc = $q->param('desc' ); $desc2 = $q->param('desc2' ); $ref = $q->param('ref'); $type = $q->param('type'); $b = rindex( $url, "/" ); $base = substr( $url, ($b +1) ); $ibase = $base; $b = rindex( $base, "." ); $base = substr( $base, 0, $b ); $filename = "html/".$base.".html"; unless( open( FH, ">".$filename) ) { print "Can't create $filename : $!

\n"; $cd = `pwd`; print "Current Directory: $cd\n"; &htmltrailer; exit(0); } print FH "\n"; print FH "$filename: Hemispheric Institute Course Materials/Archive\n"; print FH "\n"; print FH "File Type: $type
\n"; print FH "File Name: $ibase
\n"; print FH "Description: $desc\n
\n"; print FH "Reference: $ref
\n"; print FH "Click on the image for a larger view


\n"; if( $type = 'img' ) { print FH "\"$alt\"\n"; } else { print FH "$url\n"; } print FH "$desc2\n


\n"; print FH "\n"; close( FH ); print "$filename has been written. Thanks
\n"; print "Return to Form\n"; &htmltrailer; exit(0); sub htmlheader { $msg = $_[0]; print "Content-type: text/html\n\n"; print "$msg: Hemispheric Institute\n"; print "\n"; } sub htmltrailer { print "\n"; }