$conn=mysql教程_connect("localhost","root","");
$db=mysql_select_db("gan");
mysql_query("set names 'gbk'");
?>
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.phprm.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
php分页代码(下一页 上一页)
//分页代码二
?>
字符串截取代码
function my_sub_str($string, $sublen, $start)
{
$pa = "/fdddd";
preg_match_all($pa, $string, $t_string);
if(count($t_string[0]) - $start > $sublen) return join('', array_slice($t_string[0], $start, $sublen))."...";
return join('', array_slice($t_string[0], $start, $sublen));
}
php统计器代码(在线人数据统计程序源码)
$time = gettimeofday(void);
//文件初始化 start
if(@filesize("time.text")<=0){
php分页代码
class page extends mysql
{
public $page;
public $page_size;
private $table;
private $condition;
private $limit;
private $href;
private $action_value;
private $url_value;
//分页初始化
php 模拟用户POST GET源代码
if(function_exists('curl_init'))
{
$ch = curl_init();
curl_setopt($ch, curlopt_url, $url_with_get);
curl_setopt($ch, curlopt_post, 1);
curl_setopt($ch, curlopt_postfields, $post);
curl_setopt($ch, curlopt_returntransfer, true);
$result = curl_exec($ch);
curl_close($ch);
}
else
{
$content = http_build_query($post)
$content_length = strlen($content);
$context =
array('http' =>
array('method' => 'post',
'user_agent' => $user_agent,
'header' => 'content-type: ' . $content_type . " " .
'content-length: ' . $content_length,
'content' => $content));
$context_id = stream_context_create($context);
$sock = fopen($url_with_get, 'r', false, $context_id);
$result = '';
if ($sock)
{
while (!feof($sock))
$result .= fgets($sock, 4096);
fclose($sock);
}
return $result;
}
}
php url,日期,ip,邮箱地址检测类代码
//调用方法
//ip检测
php正则判断中文字符
php教程正则判断中文字符
双字节字符编码范围
php静态文件生成类
ajax简单与ajax+php实例应用(1/4)
[ajax介绍]
ajax是使用客户端脚本与web服务器交换数据的web应用开发方法。web页面不用打断交互流程进行重新加裁,就可以动态地更新。使用ajax,用户可以创建接近本地桌面应用的直接、高可用、更丰富、更动态的web用户界面。
php父类与子类读取数据代码
function getsubcomments($parent = 0, $level = 0) {
$db = &jfactory::getdbo();
$sql = "..."; // 查询记录的sql
$db->setquery($sql);
$rows = $db->loadobjectlist();
php无需数据库访问者计数器(txt文本保存数据)
include ("counter.php")
?>
<html>
<head>