Re: php question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Alexander
Date:  
To: plug-discuss
Subject: Re: php question
mike hoy wrote:

> i have a script that displays the contents of a directory. nice little
> script all i have to do is drop items in and they show up in a list.
>
> the only problem i have is now I would like to specify the window size
> using javascript or php whichever is easier so the .swf files get
> viewed at the correct width and size window.
>
> this is what i have:
>
> <?     //the path to your folder from your root dir
>    $path = 
> "/directory/directory/directory/";                                // open
>    $dir_handle = @opendir($path) or die("Unable to open $path"); 
>                              //loop thru it all
>    while ($file = readdir($dir_handle)) {                            
>    if($file == "." || $file == ".." || $file == "index.php" ) 
>                              continue;
>    echo "<a href=\"$file\" target='blank'>$file</a><br>"; 
>                             }                            //close
>    closedir($dir_handle);                       ?>

>
> I'm guessing :
> "<a href=\"$file\" target='blank'>$file</a><br>"; needs
> javascript:void(0)"onclick="window.open('filename.ext','linkname','height=700,
> width=750,scrollbars=no')"
>
> somewhere in the code
>
> i've tried:
> to mash these two lines of code together but have no success so far.
> it worked fine when I added target="_blank"
> is there php code that will let me specify the width and height of the
> window?
>


You might try the AZPHP group in the future:

http://azphp.org/

This should do what you want:

echo "<input type=\"button\"
onclick=\"window.open('$file','mywindow','height=700,
width=750,scrollbars=no')\"> $file<br>\n";

--
Get Firefox!
http://getfirefox.com/


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss