あなたのスタイルスイッチ機能で、あなたのメインページで
<head>
<!-- bla bla -->
<link rel="stylesheet" media="screen, projection" type="text/css" id="css" href="<?php echo switch_style();?>" />
<head>
:同じドメイン上のスイッチャー、あなたの特定の質問(私には不明)に適応すること例えばのような簡単なことを行うには2000個の方法があります
function build_css($style) {
$css_file='style/'.$style.'/style.css'; // providing here your css path
return $css_file;
}
function switch_style() {
$style_dispo = array('default','style1','style2','style3','style4','style5');
$current_style = ((isset($_SESSION['nav_style'])) AND ($_SESSION['nav_style'] != '')) ? $_SESSION['nav_style'] : 'default';
// There you can adapt the style switch to your need, for example based on the $_SERVER(REQUEST_URI) in your case i/o a GET test case like here
$new_style = (isset($_GET['style'])) ? $_GET['style'] : '';
// style change
if (($new_style != $current) AND ($new_style !=''))
{
if (in_array($new_style,$style_dispo))
{
$style= $new_style;
$_SESSION['nav_style']=$style;
}
else
{
$style ='default';
$_SESSION['nav_style']=$style;
}
}
else
{
$style = $current_style;
$_SESSION['nav_style'] = $style;
}
return build_css($style);
}
何を達成しようとしていますか?例を挙げてください。私はこれを行うことによって何の意味も分かりません – sll