php输出html代码
<ulclass="navnavbar-navnavbar-right"><liclass="nli"><ahref="/About/">关于我们</a></li><li...
<ul class="nav navbar-nav navbar-right">
<li class="nli"><a href="/About/">关于我们</a></li>
<li class="nli"><a href="/Notice/">舞蹈</a></li>
<li class="nli"><a href="/Instructors/">师资阵容</a></li>
</li>
</ul>
想吧这段代码用php输出 和html看到的效果一样即可
因为用php写了个判断句
<?php
if (isset($_COOKIE["cncookise"])
echo "上面那段代码";
if (isset($_COOKIE["encookise"]))
echo "对不起错误";
?> 展开
<li class="nli"><a href="/About/">关于我们</a></li>
<li class="nli"><a href="/Notice/">舞蹈</a></li>
<li class="nli"><a href="/Instructors/">师资阵容</a></li>
</li>
</ul>
想吧这段代码用php输出 和html看到的效果一样即可
因为用php写了个判断句
<?php
if (isset($_COOKIE["cncookise"])
echo "上面那段代码";
if (isset($_COOKIE["encookise"]))
echo "对不起错误";
?> 展开
1个回答
展开全部
其实很简单,只要把html语句中的双引号改为单引号,然后直接用echo输出就行了:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<ul class="nav navbar-nav navbar-right">
<li class="nli"><a href="/About/">关于我们</a></li>
<li class="nli"><a href="/Notice/">舞蹈</a></li>
<li class="nli"><a href="/Instructors/">师资阵容</a></li>
</li></ul>
<?php
echo("<ul class='nav navbar-nav navbar-right'>");
echo("<li class='nli'><a href='/About/'>关于我们</a></li>");
echo(" <li class='nli'><a href='/Notice/'>舞蹈</a></li>");
echo(" <li class='nli'><a href='/Instructors/'>师资阵容</a></li>");
echo("</li></ul>");
?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<ul class="nav navbar-nav navbar-right">
<li class="nli"><a href="/About/">关于我们</a></li>
<li class="nli"><a href="/Notice/">舞蹈</a></li>
<li class="nli"><a href="/Instructors/">师资阵容</a></li>
</li></ul>
<?php
echo("<ul class='nav navbar-nav navbar-right'>");
echo("<li class='nli'><a href='/About/'>关于我们</a></li>");
echo(" <li class='nli'><a href='/Notice/'>舞蹈</a></li>");
echo(" <li class='nli'><a href='/Instructors/'>师资阵容</a></li>");
echo("</li></ul>");
?>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询