易截截图软件、单文件、免安装、纯绿色、仅160KB

用PHP构建自定义搜索引擎Sphinx

1. 创建索引
$ sudo /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --all
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
using config file '/usr/local/etc/sphinx.conf'...
indexing index 'catalog'...
collected 8 docs, 0.0 MB
sorted 0.0 Mhits, 82.8% done
total 8 docs, 149 bytes
total 0.010 sec, 14900.00 bytes/sec, 800.00 docs/sec
2.  search 测试索引
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=8, weight=1, assembly=5, model=7
id=8
partno=ENG088
descrīption=Cylinder head
price=55
2. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
$ /usr/local/bin/search --config /usr/local/etc/sphinx.conf wind
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'wind ': returned 2 matches of 2 total in 0.000 sec
displaying matches:
1. document=1, weight=1, assembly=3, model=1
id=1
partno=WIN408
descrīption=Portal window
price=423
2. document=5, weight=1, assembly=3, model=1
id=5
partno=WIN958
descrīption=Windshield, front
price=500
words:
1. 'wind': 2 documents, 2 hits
$ /usr/local/bin/search \
--config /usr/local/etc/sphinx.conf --filter model 3 ENG
Sphinx 0.9.7
Copyright (c) 2001-2007, Andrew Aksyonoff
index 'catalog': query 'ENG ': returned 1 matches of 1 total in 0.000 sec
displaying matches:
1. document=9, weight=1, assembly=5, model=3
id=9
partno=ENG976
descrīption=Large cylinder head
price=65
words:
1. 'eng': 2 documents, 2 hits
PHP调用Sphinx搜索引擎
<?php
include('sphinx-0.9.7/api/sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer( "localhost", 3312 );
$cl->SetMatchMode( SPH_MATCH_ANY );
$cl->SetFilter( 'model', array( 3 ) );
$result = $cl->Query( 'cylind


相关文档:

html、asp、php、jsp 禁止缓存的方法

HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP:
header("Expires: Mon, 26 Jul 1997 ......

fedora下php环境.txt

安装mysql
==================
1.yum install mysql*
2.启动:/sbin/service mysqld start
安装php
=================
1.yum install php
2.查看php安装目录:whereis php
安装lighttpd
=================
1.yum install lighttpd
2.yum search lighttpd(检测lighttpd没有被安装的依赖包)
3.yum install lighttpd ......

PHP下载CSS文件中的图片

作为一个资深并且专业的扒皮人员,在我从初三开始投入伟大的互联网中到现在积累了丰富的扒皮经验。我相信每个做web的程序员也都会有类似的经历。
在扒皮过程中,必不可少的需要下载样式文件中的图片。碰到比较庞大的样式文件,其中可能会有上百个需要下载的图片,那么使用下面这段小代码是最为合
适的了。
< ?php
/* ......

PHP 生成随机数

function randomkeys($length)
{
 $key='';
 $pattern='123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
 for($i=0;$i<$length;$i++)
 {
   $key .= $pattern{mt_rand(0,47)}; 
       
  }
   ......

linux服务器用PHP的PDO链接myql方法(php pdo)

PDO为何物
POD(PHP Data Object)扩展在PHP5中加入,PHP6中将默认识用PDO连接数据库,所有非PDO扩展将会在PHP6被从扩展中移除。该扩展提供PHP内置类 PDO来对数据库进行访问,不同数据库使用相同的方法名,解决数据库连接不统一的问题。
我是配置在windows下做开发用的。
PDO的目标
提供一种轻型、清晰、方便的 API
统 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号