I'm trying to get a form to work with php. When I click submit a submit button nothing happens.


  echo "Test: ";
<form id="setImages" action="index.php" method="POST" enctype="multipart/form-data">
$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('../Home'));
$images = new RegexIterator($files, '/\.(?:jpg|png|gif)$/i');
foreach($images as $file)
  echo "<div class='images'>\n";
  echo "<img class='thumbNail' id='". htmlspecialchars($images->getFileName()) . "'src='". htmlspecialchars($images->getFileName()) . "' alt='Home Images' />\n ";
  echo "<div class='imagesSelectButton'>\n";
  echo "<input id='imageSelectButton' name='imageSelectButton' type='button' value='Select' />\n";
  echo "</div>\n";
  echo "</div>\n";

Recommended Answers

All 3 Replies

Explain: nothing happens.

you can use submit instead of button. try to analyze this code.

//assume that the file name of this script is test.php

    echo "test";

 echo "<form action='test.php' method='post'>";
 echo "<input type='submit' name='submit' value='Test'>";
 echo "</form>";
commented: well spotted +14
commented: Yes +7

Just a humble question from me :)...I thought when using the RecursiveIteratorIterator class goes by this pattern

$the_iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($some_arr));

So, by looking at your codes, I assumed that your are trying to filter the $the_iterator by RegexIterator which is obviously are images.

on your codes, the array is this one


Is it just a place holder?, or this is what you are trying to run with the script?

JUst asking, maybe I can learn something new from this thread :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.