Jump to content

Array Values and Form Elements


nblackwood

Recommended Posts

Hey everyone. I have a project I'm working on and am having some issues. I'm trying to build a web-based FTP program for a client. I have all the ftp stuff down packed, but I'm having issues with connecting to a local computer. I can get the directories an a local disk viewing and changing just fine, my problem is I'm wondering how I might pass each value of the array generated by the scandir() function into a form element value such as a checkbox. The furthest I've been able to get with this is displaying the last object in the array. Here is some code:

 

<?php

 

foreach ($d as $key => $val)

{

echo "<table width=auto height=auto border=0>

  <tr>

    <td><img src=".$icon." width=16 height=16></td>

    <td>".$val."</td>

    <td><input name=selection type=checkbox value=".$val."></td>

  </tr>

</table>";

?>

 

All I get is the last item in the array. any help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/211177-array-values-and-form-elements/
Share on other sites

Archived

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

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