Hello, 1. you must have a frame system with two frames: frame1 called fileslist, fametwo called: preview when you build the files list do like this: <? while (list(, $filename) = each($filesarray)) { echo "<li><a href="javascript:display('$filename')">$filename</a>"; } ?>
then declare a javascript function as: <script> function display(filename) { window.frames['preview'].location = filename; } </script> should work. //Elias "Alia Mikati" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello everybody, > I hope u can help me with this. I'll be very grateful! > This file retrieves a list of files from a folder on the server and then > has to diplay a list of them. When selecting one of them in the list, it > should display a preview (i.e. its contents) in the same file. I think i > should use frames but donno how to do it :(. > Thx a lot > > > > <?PHP > $d = dir("/home/mcms/public_html/MCMS/Alia/pageTmp"); > ?> > > <html> > <head> > </head> > <body> > <form method="POST" action="showTree.php"> > <p><b>Plz select a page template:</b></p> > <p><select size="1" name="pageList" > > > <?PHP > while (false !== ($entry = $d->read())) > { > if ($entry != '.' && $entry != '..') > echo '<option value="'.$entry.'">'.$entry.'</option>.\n'; > } > ?> > > </select></p> > <p><input type="submit" value="Create" name="createButton" > > <input type="hidden" > value="/home/mcms/public_html/MCMS/Alia/pageTmp/" name="pageField" /></p> > > > <?PHP > /*if (!$file = fopen("/home/mcms/public_html/MCMS/Alia/pageTmp/ > $pageList", "rb")){ > echo("couldnt open the file."); > } else{ > fpassthru($file); > }*/ > ?> > > </form> > </body> > </html> > > <?PHP > $d->close(); > ?> > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php