Jump to content

[SOLVED] Problem...


trecool999

Recommended Posts

Ok, I've got this to work:

<?php

echo "<form>
  <select name=\"Files\">\n";

$dirpath = "./";

$dh = opendir($dirpath);

while (false !== ($file = readdir($dh)))
{
    if(substr($file,  -4, 4) == '.txt')
    {
        if (!is_dir($dirpath . '/' . $file))
        {
            $f = htmlspecialchars(ucfirst(preg_replace('/\..*$/', '', $file)));
            echo '    <option value="' . $file . '" onClick="form1.Title.value += \'' . $f . '\'">' . $f . "</option>\n";
        }
    }
}
closedir($dh);

echo "</select>
</form>";

?>

 

But I need it so it doesn't capitalise the first letter when you copy it, or if it is easier, when it displays it in the list... This is probably really obvious for some of you, so don't insult me.

Link to comment
https://forums.phpfreaks.com/topic/38291-solved-problem/
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.