Jump to content

Archived

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

vidyashankara

HTML Form help

Recommended Posts

I have 2 php files. The first one writes a few text files and saves them.
The second page need to open these pages again. How do i define the files that are saved? The number of files saved in each session may vary.

For eg.
the first page displays

[code]
The following PDB files have been generated:
2a01_a.pdb
2a01_b.pdb
2a01_c.pdb
2a01_AC9.pdb
2a01_HOH.pdb

Generate Input(link to 2nd page)
[/code]


How do i tell the 2nd page to open the above files? Right now, I have checkboxes for every file to submit the value of the file. But is it possible to hide the checkboxes? They must not show up...

Thanks
Vidyashankara

Share this post


Link to post
Share on other sites
If you want to open the files use fopen:

[a href=\"http://us3.php.net/fopen\" target=\"_blank\"]http://us3.php.net/fopen[/a]

In order to know what the filename is you'll want to create the file then perhaps set each file name to an array and pass that array in session data. Then on the next page you search for that session data and open the files.

Share this post


Link to post
Share on other sites
Not sure what your saying but if your not sure how many files are going to be generated by the previous script you can put the generated filenames in an array with something similar to the following.

Just rember this will grab every file in the folder of $path.

[code]

$path = "/path/to/your/files/";

if ($handle = opendir($path)) {

     while (false !== ($file = readdir($handle))) {
          if ($file <> "." and $file <> "..") {
          $dir[$I] = "$file";
          $I++;                                
          }
     }
     closedir($handle);                                  
}
[/code]

Share this post


Link to post
Share on other sites

×

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.