HTML
<html>
<head>
<title>DNA Analyse</title>
<h2 align="center">DNA Translation aplication</h2>
<link rel="StyleSheet" href="stylesheet.css" type="text/css">
</head>
<body>
<br/>
<form action="dna.php" method="post">
<textarea name="dnaseqin" rows="10" cols="60">
Intput DNA sequence here
</textarea>
<br/><br/>
How too use:</br>
Enter the nucleotide sequence in to the text area above any character is valid but only a,c,t & g's will be translated. Input may be in upper or lower case. If you are copying the nucleotide sequence from a fasta file, then please remove the header "> description", because this is likely to contain any of the base letters, (a, c, t & g).
<br/>
<div id="menu">
<br/>
<br/>
<h2>
Menu
</h2><br/>
<input type="radio" name="select" value="pro" checked> Protein Translation<br/>
<input type="radio" name="select" value="rev"> Reverse Complement<br/>
</form></br>
<input type="submit" value="Submit Form" />
<input type="reset" value="Reset Form" />
</div>
</body>
</html>
PHP
<html>
<head> PHP Translation Script </head>
<body>
<?php
$dnaseq = $_POST['dnaseqin'];
$input = fopen("temp/filein",'w');
fwrite($input, $dnaseq);
fclose($input);
switch($_POST["select"]){
case "pro":
exec("./proteintranslate");
$filename="temp/outfile";
$output = fopen($filename, "r");
$proseq = fread($output, filesize($filename));
fclose($output);
print $proseq;
exec("rm -rf temp/filein");
exec("rm -rf temp/outfile");
break;
case "rev":
exec("./rev_comp");
print "hello";
$filename="temp/outfile";
$output = fopen($filename, "r");
$revcomp = fread($output, filesize($filename));
fclose($output);
print $revcomp;
exec("rm -rf temp/filein");
exec("rm -rf temp/outfile");
break;
}
?>
</body>
</html>