我的ASP是这样写的。最近改为PHP。这里不会写。请前辈指点。谢谢。
<%if Request.Cookies("maya")<>"" then%>
<link href="<%=Request.Cookies("maya")%>" rel="stylesheet" type="text/css">
<%else%>
<link href="style1.css" rel="stylesheet" type="text/css">
<%end if%>

解决方案 »

  1.   

    //某处设置 cookie
    setcookie ("TestCookie", "", time() - 3600);//某处读取cookie
    echo $_COOKIE["TestCookie"];
      

  2.   

    我已经在cookie文件夹里生成一个[email protected][2].txt文件了。我想读取里面maya的值。
      

  3.   

    $strCookie = file_get_contents("[email protected][2].txt");
    //然后正则获取
      

  4.   


    if(isset($_COOKIE['maya']))
    {
        echo '<link href="'.$_COOKIE['maya'].'" rel="stylesheet" type="text/css">';
    }
    else
    {
        echo '<link href="style1.css" rel="stylesheet" type="text/css"> ';}