AI编程助手
AI免费问答

简单的切换网页版本

PHP中文网   2016-05-26 08:20   1459浏览 原创
跳至   
nbsp;html>


<meta><title>首页</title><style>
header {
    text-align: right;
}
#change-feeling {
    text-decoration: none;
    font-size: small;
}
#form-section {
    text-align: center;
    margin-top: 1em;
    padding-top: 100px;
}
#input {
    width: 40em;
    padding: 0.5em 0.2em;
    font-size: large;
}
</style><script>
function changeFeeling(feeling) {
    var now = new Date();
    var nextYear = new Date(now.getTime() + 3600000 * 24 * 365);
    document.cookie = &#39;feeling=&#39; + feeling + &#39;; expires=&#39; + nextYear.toGMTString();
    
    location.reload();
}

</script><header><?php if (array_key_exists(&#39;feeling&#39;, $_COOKIE)) {
    $feeling = $_COOKIE[&#39;feeling&#39;];
} else {
    $feeling = &#39;old&#39;;
}

if ($feeling === &#39;new&#39;) {
    echo <<<EOT
<style class="feeling">
body {
    background: #80E0F0;
}
#input {
    height: 2em;
    font-family: "微软雅黑";
}

<a>返回旧版</a>
EOT;
} else {
    echo 使用新版
EOT;
}
?>
</header><section><input></section>
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。