Jump to content


Photo

HTML Form help


  • Please log in to reply
2 replies to this topic

#1 vidyashankara

vidyashankara
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 12 June 2006 - 06:30 PM

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

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)


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

#2 Buyocat

Buyocat
  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 12 June 2006 - 07:23 PM

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.
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#3 d_barszczak

d_barszczak
  • Members
  • PipPipPip
  • Advanced Member
  • 188 posts
  • LocationBradford - UK

Posted 12 June 2006 - 09:53 PM

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.


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

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

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

When all else fails - Try reading the manual.

Integrated IT Systems Ltd





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users