如何从php中的目录调用多个CSS样式表

The idea is to have multiple stylesheets in a directory. The user will choose what stylesheet they want from a drop down menu that's called by the search_dir() function.

$search_dir = '../css';
$contents = scandir($search_dir);

Keeping in mind I'm new to PHP, how would I get the styleseet to work once a user hits the submit button? Currently I'm trying this

<link href="<?php echo $_POST["power"]; ?>" rel="stylesheet">

..where power is the name of the select.

<select class="" id="power" name="power" tabindex="1" >

So once the user hits submit after selecting "styleone.css" the style would change. If they chose "styletwo", it would change to that style.

I hope I gave enough information for you guys to help me with this.

EDIT:

here is my select, option, ect section:

<label for="power">Choose your POWER!!</label>
        <select class="" id="power" name="power" tabindex="1" >
        <?php
        echo '<option value="">Choose Here!!</option>';
        foreach($contents as $item):
            if((is_file($search_dir.'/'.$item)) AND (substr($item, 0, 1) != '.')):
                if($item == $_POST["power"]):
                    echo "<option value=\"$item\" selected=\"selected\"> $item </option>";
                else:
                    echo "<option value=\"$item\"> $item </option>";
                endif;
            endif;
        endforeach;
        ?>
        </select>

I hope this helps clarify more

Two things to note: 1:- The link to the css should have the relative path by prefixing with "../css" as i see you are trying to scan a folder "../css"

<link href="../css/<?php echo $_POST["power"]; ?>" rel="stylesheet">

2:- iterate through the list of contests and add to the dropdown list. Note. as you are scanning the folder you may get the special folders as well in the list "." and ".." ( dot and double dot ), which you may want to ignore and strip out before adding to the option.

<form method="post">
<select class="" id="power" name="power" tabindex="1" >
<?php
        for ( $i=0; $i<count($contents); $i++ ) {
                echo '<option value="' . $contents[$i] . '">' . $contents[$i] . '</option>';
        }
?>
</select>