raman Posted December 18, 2008 Share Posted December 18, 2008 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 !"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/137506-automatic-pop-up-java-applet/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.