Jump to content

sample data load but no processing in php form


raman

Recommended Posts

I have a form called phylogeny.php in which I have a text box , I used a javascript to load data into that from a link.

The code is :

<textarea cols="75" rows="8" name="seq">
</textarea><td><a href="#" onclick="sendText(document.form1.seq, '>YES_XIPHE\nMGCVRSKEAKGPALKYQPDNSNVVPVSAHLGHYGPEPTIMGQSPA--MK-TQNNSHPTAL\nSPFGGVSSPMTPFGGASTSFTSVTVNNPFPAVITGGVTFFVALYDYEARTSDDLSFRKGD\nRFQIINNTEGDWWEARSINTGENGYIPSNYVAPADSIQSEEWYFGKLSRKDTERLLLLPG\nNERGTFLIRESETTKGAYSLSLRDWDETKGDNCKHYKIRKLDNGGYYITTRTQFMSLQML\nVKHYTEHVDGLCYKLTTVCPQVKPQTQGIAKD')">Load</a> demo data<p><a href="#"  onClick="sendText(document.form1.seq,'')">Clear</a> the data </p></td>

 

the javascript is :

function sendText(e, text)
{
  e.value = text
}

However the phylogeny_tool.php in the action of the above script stopped processing this input data:This is phylogeny_tool.php:

$seq=$_POST['seq'];
if (!is_writable("./files/$seqfile")) 
{
  if (!$handle = fopen("./files/$seqfile", "w"))
    {
      echo "Cannot open file (./files/$seqfile)";
      exit;
    }
  
  // Write $somecontent to our opened file.
  if (fwrite($handle, $seq) === FALSE) 
    {
      ++$freq;
      //echo "Cannot write to file ($seqfile)";
      exit;
    }
  
  //echo "Success, wrote ($somecontent) to file ($seqfile)";
  
  fclose($handle);
}else 
{
  echo "The file ./files/$seqfile is not writable";
}
$rfile=$seqfile.'.stockholm';
  $yrfile='files/'.$rfile;
  echo "<font size=4>Your input sequence/file - <a href=files/$seqfile>Input file</a></font><br>";
  system("hmmer-2.2/binaries/sreformat stockholm files/$seqfile > $yrfile");
  system("quicktree_1.1/bin/quicktree -in a -out t -boot $boot $upg $kim $yrfile >files/$outfile");
  
echo "<font size=4><br>Result - <a href=files/$outfile>file<br><br></a></font>";

 

(edited by kenrbnsn to fix the


tags)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.