Hi Guys,
I’m trying to display an image on a live php page, wihich is already uploaded to a directory:
So in my admin section I have this code:
<select name="image">
<option value="" selected>select an image...</option>
<?php
$query = mysql_query("SELECT * FROM `images`");
while($reza = mysql_fetch_assoc($query)){
?>
<option value="<?php echo $reza['url']; ?>"><?php echo $reza['name']; ?></option>
<?php
}
?>
</select>
Now this is a dropdown list which looks in my SQL images table for each image in the directory. This tale holds the name of the image, which is displayed on the dropdown.
What I want to do is make a form (post) the above so that when submit, the selection I have made is held in memory and I can go in and change that image as needed – then the selected image is displayed on my live site using;
<img src="images/<?php echo"$image"; ?>">
Not sure how I’d modify the dropdown though to do this, so it can be modified and the selection is held.
Any ideas?
Thanks
I’m trying to display an image on a live php page, wihich is already uploaded to a directory:
So in my admin section I have this code:
<select name="image">
<option value="" selected>select an image...</option>
<?php
$query = mysql_query("SELECT * FROM `images`");
while($reza = mysql_fetch_assoc($query)){
?>
<option value="<?php echo $reza['url']; ?>"><?php echo $reza['name']; ?></option>
<?php
}
?>
</select>
Now this is a dropdown list which looks in my SQL images table for each image in the directory. This tale holds the name of the image, which is displayed on the dropdown.
What I want to do is make a form (post) the above so that when submit, the selection I have made is held in memory and I can go in and change that image as needed – then the selected image is displayed on my live site using;
<img src="images/<?php echo"$image"; ?>">
Not sure how I’d modify the dropdown though to do this, so it can be modified and the selection is held.
Any ideas?
Thanks