这周因为考试的关系所以没能抽出很多时间学习新知识,只学了cookie的创建及应用,并把前段时间学习的知识上机实现。在操作过程中,发现存在2个问题:1.对代码不熟悉 2.对这个知识框架体系不熟悉,往往在写代码中忘记了前后的联系。
<! DOCTYPE html PUBLIC"-//w3c//DTD XHTML 1.0 Transitional//EN "
"http://www.w3.org/TR/xhtml 1/DTD/xhtml 1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml: lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Welcome!</title>
<style type="text/css">
body{<?php
if(isset($_COOKIE['font_size']))
{print "\t\tfont-size:" . htmlentities($_COOKIE['font_size']) . ";\n";}
else{ print "\t\tfont-size:medium;";}
if(isset($_COOKIE['font_color']))
{print "\t\tcolor:" . htmlentities($_COOKIE['font_color']) . ";\n";}
else {print "\t\tcolor:#000;";}
?>}
</style>
</head>
<body>
<p> example</p>
</body>
</html>