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