Jump to content

automatic pop-up java applet


raman

Recommended Posts

I have a php script in which I provide input to a java-applet, I want that the java-applet to open up automatically as that page loads, and as a separate pop-up window, however right now in my code it is embedded within the browser window.

 

Can someone say how this can be done?

My script is :



<?

$rand=rand(0, 1111111);
$seqfile =  $rand .'.'.'stockholm';
$seq=$_POST['seq'];
$userfile=$_FILES['userfile']['tmp_name'];
$boot=$_POST['boot'];
$outfile=$rand.'.'.'out';
$pattern = '/>/';

  if (preg_match($pattern,$seq))
    {
      $somecontent=$seq;
    }
  else
    {
      $somecontent = ">sequence\n".$seq;
    }

$freq=0;
// Let's make sure the file exists and is writable first.
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, $somecontent) === 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";
}


#__________________________________________________________________________#

############################## CLUSTALW commands ###########################
#$logfile=$rand.'.logfile';
if($seq == '' && $userfile == ''){
  echo "<font color='#d11010' size=4><blink>Warning </blink>: Please enter sequence or sequence file</font> ";

}elseif($seq == ''){
  $file_data= implode("",file($userfile));
  $upfile=$rand.'.fa';
  $ofile=$upfile.'.stockholm';
  $pfile='files/'.$ofile;
  $f=fopen("./files/$upfile","w");
  fwrite($f,$file_data);
  fclose($f);
 
  echo "<font size=4>Your input seq/seqs - <a href=files/$upfile> Input file</a><br><br></font>";
  // $yrfile="'input'.targetdbin/$seqfile";
  system("hmmer-2.2/binaries/sreformat stockholm files/$upfile > $pfile");
  system("quicktree_1.1/bin/quicktree -in a -out t -boot $boot $pfile >files/$outfile");
// echo "<font size=4><br><a href=output>Logfile</a> for ClustalW run</font><br>";
echo "<font size=4><br>Result - <a href=files/$outfile>file<br><br></a></font><br>";
echo"<APPLET ARCHIVE='forester.jar' CODE='org.forester.atv.ATVe.class' NAME='ATV' WIDTH='600' HEIGHT='500' ALT='ATV Applet is not working on your system (requires at least Sun Java 1.5)!'><PARAM NAME='url_of_tree_to_load' VALUE='http://localhost/protvirdb/files/$outfile'><PARAM NAME='config_file' VALUE='_atv_configuration_file'><param name='embedded' value='true'>Your browser is completely ignoring the <APPLET> tag!</APPLET>";

}elseif($userfile == ''){
  $rfile=$seqfile.'_rea';
  $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 $yrfile >files/$outfile");
 
# system("cat prefile targetdbin/$logfile endfile > yfile");
//  echo "<font size=4><br><a href=$logfile>Logfile</a> for ClustalW run</font><br>";
echo "<font size=4><br>Result - <a href=files/$outfile>file<br><br></a></font>";
echo"<APPLET ARCHIVE='forester.jar' CODE='org.forester.atv.ATVe.class' NAME='ATV' WIDTH='600' HEIGHT='500' ALT='ATV Applet is not working on your system (requires at least Sun Java 1.5)!'><PARAM NAME='url_of_tree_to_load' VALUE='http://localhost/protvirdb/files/$outfile'><PARAM NAME='config_file' VALUE='_atv_configuration_file'><param name='embedded' value='true'>Your browser is completely ignoring the <APPLET> tag!</APPLET>";

 
}else{

          echo "<font color='#d11010' size=4><br><br><br><blink><img src='./protozs/error.gif'></blink><br><br>Error : Select either file from browser or enter sequence in Text area !";

        }


?>

Link to comment
https://forums.phpfreaks.com/topic/137506-automatic-pop-up-java-applet/
Share on other sites

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.