#!/usr/bin/perl use CGI; ## Get the query that got us here. $query = new CGI; ## Save all the parameter names in an array. @names = $query->param ; ## We'll need to test for the existence of some names later, ## so lets make a hash out of them too. %names = (); foreach ( @names ) { $names{$_} = 1; } ## Start building the page we send back to the user. print $query->header, "\n"; print $query->start_html( -title=>"We've Moved", -BGCOLOR=>"#ffffff" ), "\n"; print "
"; print "\"We've\n"; print "
"; print <<"END_PRINT";

We've moved our $ENV{SCRIPT_NAME} from $ENV{SERVER_NAME} to statweb.unc.edu.

The URL which brought you here needs to change from
   http://$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}
to
   http://statweb.unc.edu/cgi-bin/broker
as soon as possible.

In the mean time, you can use the button below to resubmit your request to the new server. END_PRINT ## Make a form that goes to the correct broker. ## Put a hidden field for each parameter that was passed to us. ## This way we get to send essentially the same request to the ## statweb broker. print $query->startform( -action => "http://statweb.unc.edu/cgi-bin/broker"), "\n"; foreach ( @names ) { print $query->hidden( -name => $_, -default => $query->param($_) ), "\n"; } ## Now we need a submit button with a unique name. ## Make sure we aren't using a name that matches one of ## our parameters... $subname = "submit"; while ( defined $names{$subname} ) { $subname++; } ## Okay, we've got a unique name for our submit button. ## Blurt it out and we're done. print "
\n", $query->submit( -name => $subname, -value => "Resubmit Request to New Server" ), "
\n"; print $query->endform, "\n"; print $query->end_html; exit 0;