Jump to content

[SOLVED] Getting Select Form Info


Recommended Posts

Hey... again :)

 

I'm attempting to gather the information from a dynamic select form. Here is what I currently have:

 

delete.php:

<?php
echo '<center>';

echo '<h1><u>Delete a Photo</u></h1>';

echo '<form action="deletePicture.php" method="post">';
	echo '<select name="photosInDirectory" id="photosInDirectory">';
		foreach(glob('*.jpg') as $picForDropDown)
		{
			echo '<option value="'.$picForDropDown.'">'.$picForDropDown.'</option>';
		}
	echo '</select>';

	echo '<input type="submit" value="Delete">';
echo '</form>';

echo '</center>';
?>

 

and deletePicture.php:

<?php
$picureToDelete = $_POST['photosInDirectory'];

echo $pictureToDelete;
?>

 

Seems not to work though. Basically, I'd like to get the full value of the option they selected (either the value or the display name, doesn't matter right now).

 

Thanks for the help again!

FlyingIsFun1217

Link to comment
https://forums.phpfreaks.com/topic/107702-solved-getting-select-form-info/
Share on other sites

if it makes you feel any better, I first read your thread about 2 minutes after you posted it (like an hour ago), tested and messed around with it for about 15 minutes and gave up, thinking wtf why isn't this working, it should be working??  And came back in when you bumped it and saw it right off the bat, lol.

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.