Jump to content

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.

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.