Jump to content

Passing information via _POST


moe

Recommended Posts

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

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.