moe Posted April 1, 2008 Share Posted April 1, 2008 Hi Guys; I have successfully created a drop down listing script via the following: <?php $squidguard_dir = '/var/lib/squidguard/db/'; if ($handle = opendir($squidguard_dir)) { ?> <form action="<?=$PHP_SELF?>" method="POST"> <select name="directory_name" size="1"> <?php while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<option name=$file>$file</option>"; } } ?> </select> <input type="submit"> <?php closedir($handle); } Now when I pass that information using the _POST function to the following: <?php if ($_POST['directory_name']) { ?> <textarea rows=4 cols=40> <?php echo $directory_name; echo $file; } I am unable to get anything displayed in the textarea, its blank. I am trying to get it to echo first to make sure it is working and passing on the correct variables. Any help again would be appreciated Thanks Moe Link to comment https://forums.phpfreaks.com/topic/98928-passing-information-via-_post/ Share on other sites More sharing options...
keeB Posted April 1, 2008 Share Posted April 1, 2008 please post the output of <?php print "<pre>"; print_r($_POST); ?> Link to comment https://forums.phpfreaks.com/topic/98928-passing-information-via-_post/#findComment-506170 Share on other sites More sharing options...
kenrbnsn Posted April 1, 2008 Share Posted April 1, 2008 You need to echo the value in the $_POST array: <?php if ($_POST['directory_name']) { echo '<textarea name="somename" rows=4 cols=40>'; echo $_POST['directory_name']; echo $_POST['file']; echo '</textarea>'; } ?> Ken Link to comment https://forums.phpfreaks.com/topic/98928-passing-information-via-_post/#findComment-506172 Share on other sites More sharing options...
moe Posted April 1, 2008 Author Share Posted April 1, 2008 Thanks a lot guys...you are the best..... Link to comment https://forums.phpfreaks.com/topic/98928-passing-information-via-_post/#findComment-506175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.