#!/usr/bin/perl
#
use strict;
use warnings;
use CGI;

my $q = new CGI;
my $url = "http://swift.cmbi.ru.nl/pdb_redo/";

my $pdbid = $q->param('pdbCode');

if (defined $pdbid and -e "/home/whatif/httpd/htdocs/pdb_redo/$pdbid/index.html") {
    $url .= "$pdbid/index.html";
	print $q->redirect($url);
	exit;
}

my $msg = 'Unknown pdb identifier ';

if (defined $pdbid) {
	$msg = $msg."$pdbid";
}

print
	$q->header,
	$q->start_html('PDB-redo - unknown pdb identifier'),
        $q->p($msg),
	$q->p('Enter pdb identifier'),
	$q->start_form(-name=>'f', -method=>'GET'),
	$q->textfield(-name=>'pdbCode', -size=>6, -maxlength=>4),
	$q->submit,
	$q->end_form,
	$q->end_html;



