I have a .html file and inside it I am running php code. PHP code should open the .ini file.
".ini" file: blast+: blast+\bin blastn: test_na_db => Nucleotide test database blastp: test_aa_db => Protein test database blastx: test_aa_db => Protein test database tblastn: test_na_db => Nucleotide test database tblastx: test_na_db => Nucleotide test database ".html" file: <td valign=top> Database(s)</td> <td> <?php $fp = fopen ("./filename.ini", "r"); if(!$fp) { echo "<p><strong> Error: Couldn't open file filename.ini </strong></p></body></html>"; exit; } while(!feof($fp)) { $blastdbstring = rtrim(fgets($fp)); if (!$blastdbstring) { continue; } if (!preg_match("/^\s*#/", $blastdbstring)) { $blastdbArray = preg_split('/:/', $blastdbstring); $blastProgram = $blastdbArray[0]; $dbString = $blastdbArray[1]; if ($blastProgram == "blast+") { echo "<input type='hidden' name= 'blastpath' value='$dbString'>"; }else { if (preg_match("/^\s*(.*?)\s*$/", $blastProgram, $match)) { $blastProgram = $match[1]; } if (preg_match("/^\s*(.*?)(\s*|\s*,\s*)$/", $dbString, $match)) { $dbString = $match[1]; } $dbString = preg_replace("/\s*=>\s*/", "=>", $dbString); if (preg_match("/,/", $dbString, $match)) { $dbString = preg_replace("/\s*,\s*/", ",", $dbString); } echo "<input id='$blastProgram' type='hidden' name='blastdb[]' value='$dbString'>"; } } } fclose($fp); ?> <select id="dbList" size=4 multiple="multiple" name ="patientIDarray[]"> <script type="text/javascript"> here call js function that create options depend on the selection of previous question </script> </select> </td>
Every time I get this error message: Could not open filename.ini file !!!!
File
".html" and ".ini" are in the same directory.
I have full control over this .ini file.
Any suggestions?
source share