课程/PHP/后端开发
Duang~MySQLi扩展库来袭
-
-
Object_is_null
2017-11-13
- $res=Comment::validate($arr); //数据在自定义类方法中获取,过滤,保存
//json_encode()对变量进行JSON编码,json_decode()对JSON格式的字符串进行转换为PHP变量.
$comment的output()方法
public function output(){
if($this->data['url']){
$link_start="<a href='".$this->data['url']."' target='_blank'>";
//a标签分开写是为了能在a标签中插入其他元素
$link_end="</a>";
}
$dateStr=date("Y年m月d日 H:i:s",$this->data['pubTime']);
$res=<<<EOF
<div class='comment'>
<div class='face'>
{$link_start}
<img width='50' height='50' src="img/{$this->data['face']}.jpg" alt="" />
{$link_end}
</div>
<div class='username'>
{$link_start}
{$this->data['username']}
{$link_end}
</div>
<div class='date' title='发布于{$dateStr}'>
{$dateStr}
</div>
<p>{$this->data['content']}</p>
</div>
EOF;
return $res;
}
-
0赞 · 0采集
-
-
哎咿呦鲍鲍
2017-02-26
- $res=Comment::validate($arr); //数据在自定义类方法中获取,过滤,保存
//json_encode()对变量进行JSON编码,json_decode()对JSON格式的字符串进行转换为PHP变量.
$comment的output()方法
public function output(){
if($this->data['url']){
$link_start="<a href='".$this->data['url']."' target='_blank'>";
//a标签分开写是为了能在a标签中插入其他元素
$link_end="</a>";
}
$dateStr=date("Y年m月d日 H:i:s",$this->data['pubTime']);
$res=<<<EOF
<div class='comment'>
<div class='face'>
{$link_start}
<img width='50' height='50' src="img/{$this->data['face']}.jpg" alt="" />
{$link_end}
</div>
<div class='username'>
{$link_start}
{$this->data['username']}
{$link_end}
</div>
<div class='date' title='发布于{$dateStr}'>
{$dateStr}
</div>
<p>{$this->data['content']}</p>
</div>
EOF;
return $res;
}
-
0赞 · 0采集
-
-
黄枪枪
2017-02-10
- $res=Comment::validate($arr); //数据在自定义类方法中获取,过滤,保存
//json_encode()对变量进行JSON编码,json_decode()对JSON格式的字符串进行转换为PHP变量.
$comment的output()方法
public function output(){
if($this->data['url']){
$link_start="<a href='".$this->data['url']."' target='_blank'>";
//a标签分开写是为了能在a标签中插入其他元素
$link_end="</a>";
}
$dateStr=date("Y年m月d日 H:i:s",$this->data['pubTime']);
$res=<<<EOF
<div class='comment'>
<div class='face'>
{$link_start}
<img width='50' height='50' src="img/{$this->data['face']}.jpg" alt="" />
{$link_end}
</div>
<div class='username'>
{$link_start}
{$this->data['username']}
{$link_end}
</div>
<div class='date' title='发布于{$dateStr}'>
{$dateStr}
</div>
<p>{$this->data['content']}</p>
</div>
EOF;
return $res;
}
-
截图
0赞 · 0采集
-
-
流浪佳人纳入怀
2016-10-27
- 表单数据处理:调用过滤文件,数据库连接文件;把过滤后的的数据使用预处理写入数据库;并调用AJAX输出提示信息和output()输出评论数据。
-
截图
0赞 · 0采集
-
-
爱你PHP
2015-05-10
- 没问题后预处理插入
-
截图
0赞 · 1采集