Okay I got it populated via the file directory. I had a slash before images when I shouldn't have.
BUT...Now I am having another issue with it. The code is in a form. The user selects the image from the drop down and submits it. One the next page the image they selected is echoed in the browser.
PROBLEM:No matter which image they select the same one comes up over and over.
Here is the Form Code:
<form action="preview_news.php" method="post">
<select name='image'>
<?php
$dir = "images/news";
$dir = opendir($dir);
while (false !== ($image = readdir($dir))){
if (in_array($image, array(".", ".."))) continue;
?>
<option value='<?php echo $image; ?>'><?php echo $image; ?></option>
<?php
}
?>
</select>
And Here is the page that echos the picture (should be) based on the selection:
<?php
session_start();
$_SESSION['image'] = $_POST['image'];
$image = $_SESSION['image'];
echo "<b>IMAGE:</b><br><img src='images/news/" . $row['image'] ."' /><br><br>";
?>
I am at a loss. I got the menu populated... but it's ignoring my selection...
Any ideas?
Thanks guys!