我有一个模块“编辑信息”。要编辑的信息将显示在每个相应的字段中。但是,从数据库中提取的数据是双重调整的,不会显示。这是什么解决方案?
/* Assignment notes
-Contains <main> element and is styled with at least 2 declarations
-Contains <header> element and is styled with at least 2 declarations
-Contains <nav> element and is styled with at least 2 declarations
-Contains <footer> element and is styled with at least 2 declarations
-Has a <meta> viewport
-Font Family is declared in Body selector
-Font Size is declared in Body Selector
-Color properties and values are declared in Body selector
-Padding and Margin are declared in <img>
-Boarder Properties are declared in Content ID
-Links are formated using Pseudo Seletors
-Text Declaration is used to show Links
-All CSS is external
-Checked in Validator
*/
body {
background: #98bfcd;
border: 5px outset #fff;
width: 900px;
margin: 0 auto;
}
ol {
list-style-type: none;
margin: 10px;
padding: 0;
overflow: hidden;
background-color: #00c;
width: 461px;
}
aside {
text-align: center;
height: 500px;
}
nav li {
float: left;
text-align: left;
}
li{
text-align: left;
}
h1 {
text-align: center;
padding-top: 30px;
padding-left: 30px;
font-family: arial;
}
img{
float: right;
}
h2 {
text-decoration: underline;
font-family: Arial;
}
li a{
display: block;
color: #fff;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
footer{
float: center;
font-family: arial;
font-size: 2px;
}
/* Change the link color to #111 (black) on hover */
li a:hover {
background-color: #111;
}
#content {
}
</style>
答案 0 :(得分:1)
尝试使用htmlentities()方法:
<?php echo htmlentities($item[0] -> desc;)?>
我认为应该将"
更改为"
。
答案 1 :(得分:0)
检查表单元素之前的echo stripslashes($item[0]->desc);
是否从数据库中获取。代码没有问题。