Jump to content

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

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.