#!/usr/bin/perl -w use warnings; use CGI; #use File::Copy; my($buffer) = ""; my($firstChoice) = ""; my($secondChoice) = ""; my(@values) = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); (@values) = split(/&/, $buffer); $firstChoice = $values[0]; $secondChoice = $values[1]; ($NULL, $firstChoice) = split(/=/, $firstChoice); ($NULL, $secondChoice) = split(/=/, $secondChoice); #print "Content-type: text/plain\n\n"; #print "$firstChoice\n"; #print "$secondChoice"; my($dynamic) = "$firstChoice$secondChoice.html"; open (FH, "+>" . $dynamic); print FH "\n"; print FH " \n"; print FH " $firstChoice and $secondChoice\n"; print FH " \n"; print FH " \n"; print FH " You chose $firstChoice and $secondChoice\n"; print FH " \n"; print FH "\n"; close (FH); #These are all of the ways that I have tried to move the file and failed: #1: #rename "$dynamic", "dynamics/$dynamic"; #2: #system("mv $dynamic dynamics/"); #3: #my($original_file) = "$dynamic"; #my($new_file) = "dynamics/$dynamic"; #move($original_file, $new_file); print "Location: dynamics/$dynamic\n\n";