作者:Sysd0w
发布时间:June 1, 2010
分类:学习之路
No Comments
看了下学长的代码,从mysql的操作类里拿了些东西,insert方法和update方法的实现
// insert方法,table变量为表名,data为需要插入的数据
function insert($table, $data) {
$cols = $values = array();
// $data为一维数组,格式为array(字段=>值);
foreach ($data as $key => $value) {
$cols[] = "`$key`";
if (is_int($value)) {
$values[] = $value;
}else if ($value === null) {
$values[] = 'null';
}else {
$values[] = "'$value'";
}
}
阅读剩余部分...
作者:Sysd0w
发布时间:June 1, 2010
分类:学习之路
No Comments
系统版本:ubuntu 10.04
问题描述:
更改了密码以后,每次开机第一次连接网络都提示
Enter password to unlock your login keyring
The password you use to log in to your computer no longer matches that of your login keyring.
并需要输入旧密码。
阅读剩余部分...
作者:Sysd0w
发布时间:June 1, 2010
分类:学习之路
No Comments
来源:Ubuntu中文论坛
作者:4321go
下载:
linux 命令手册.zip
作者:Sysd0w
发布时间:May 19, 2010
分类:学习之路
No Comments
条件判断
{if 条件}
{else}
{/if}
{$smarty}变量可以用来存取$_GET,$_POST,$_COOKIE,$_SERVER,$_ENV和$_SESSION,如
{$smarty.get.page}
{$smarty.post.page}
{$smarty.cookies.username}
{$smarty.server.SERVER_NAME}
{$smarty.env.PATH}
{$smarty.session.id}
{$smarty.request.username}
阅读剩余部分...
作者:Sysd0w
发布时间:May 15, 2010
分类:学习之路
No Comments
自己乱写的php文件上传类
<?php
class upfile_class{
private $upfiledir;
private $filename;
private $filesize;
private $filetype;
private $rand;
private $file;
/*
* 构造函数
* $upfiledir //上传路径
* $file //表单文件域名字
*
*/
function __construct($upfiledir, $file){
$this->upfiledir = $upfiledir;
$this->file = $file;
$this->filename = $_FILES[$file]['name'];
$this->filesize = $_FILES[$file]['size'];
$this->filetype = $_FILES[$file]['type'];
}
阅读剩余部分...
作者:Sysd0w
发布时间:May 14, 2010
分类:学习之路
No Comments
网上看到的,自己修改了下
function ubb($strCodes) {
$match = array(
"%\[b\](.*?)\[\/b\]%si",
"%\[u\](.*?)\[\/u\]%si",
"%\[i\](.*?)\[\/i\]%si",
"%\[center\](.*?)\[\/center\]%si",
"%\[url\](.*?)\[\/url\]%si",
"%\[url=(.*?)\](.*?)\[\/url\]%si",
"%\[img\](.*?)\[\/img\]%si"
);
阅读剩余部分...
- 1
- 2
- 3
- 4
- 5
- »