Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/11798-html-form-help/
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.
Link to comment
https://forums.phpfreaks.com/topic/11798-html-form-help/#findComment-44725
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]
Link to comment
https://forums.phpfreaks.com/topic/11798-html-form-help/#findComment-44753
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.